errors

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseValidateError

func ParseValidateError(err error) error

ParseValidateError

Types

type AlreadyExistsError

type AlreadyExistsError struct {
	Resource string
}

AlreadyExistsError .

func NewAlreadyExistsError

func NewAlreadyExistsError(resource string) *AlreadyExistsError

NewAlreadyExistsError .

func (*AlreadyExistsError) Error

func (e *AlreadyExistsError) Error() string

func (*AlreadyExistsError) HTTPStatus

func (e *AlreadyExistsError) HTTPStatus() int

func (*AlreadyExistsError) Translate

func (e *AlreadyExistsError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type DatabaseError

type DatabaseError struct {
	Cause error
}

DatabaseError .

func NewDatabaseError

func NewDatabaseError(err error) *DatabaseError

NewDatabaseError .

func (*DatabaseError) Error

func (e *DatabaseError) Error() string

func (*DatabaseError) HTTPStatus

func (e *DatabaseError) HTTPStatus() int

func (*DatabaseError) Translate

func (e *DatabaseError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type Error

type Error interface {
	error
	transhttp.Error
	i18n.Internationalizable
}

type InternalServerError

type InternalServerError struct {
	Cause   error
	Message string
}

InternalServerError .

func NewInternalServerError

func NewInternalServerError(err error) *InternalServerError

NewInternalServerError .

func NewInternalServerErrorMessage

func NewInternalServerErrorMessage(message string) *InternalServerError

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

func (*InternalServerError) HTTPStatus

func (e *InternalServerError) HTTPStatus() int

func (*InternalServerError) Translate

type InvalidParameterError

type InvalidParameterError struct {
	Name    string
	Message string
}

InvalidParameterError .

func NewInvalidParameterError

func NewInvalidParameterError(name, message string) *InvalidParameterError

NewInvalidParameterError .

func (*InvalidParameterError) Error

func (e *InvalidParameterError) Error() string

func (*InvalidParameterError) HTTPStatus

func (e *InvalidParameterError) HTTPStatus() int

func (*InvalidParameterError) Translate

type MissingParameterError

type MissingParameterError struct {
	Name string
}

MissingParameterError .

func NewMissingParameterError

func NewMissingParameterError(name string) *MissingParameterError

func (*MissingParameterError) Error

func (e *MissingParameterError) Error() string

func (*MissingParameterError) HTTPStatus

func (e *MissingParameterError) HTTPStatus() int

func (*MissingParameterError) Translate

type NotFoundError

type NotFoundError struct {
	Resource string
}

NotFoundError .

func NewNotFoundError

func NewNotFoundError(resource string) *NotFoundError

NewNotFoundError .

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) HTTPStatus

func (e *NotFoundError) HTTPStatus() int

func (*NotFoundError) Translate

func (e *NotFoundError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type ParameterTypeError

type ParameterTypeError struct {
	Name      string
	ValidType string
}

ParameterTypeError

func NewParameterTypeError

func NewParameterTypeError(name string) *ParameterTypeError

NewParameterTypeError .

func (*ParameterTypeError) Error

func (e *ParameterTypeError) Error() string

func (*ParameterTypeError) HTTPStatus

func (e *ParameterTypeError) HTTPStatus() int

func (*ParameterTypeError) Translate

func (e *ParameterTypeError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type PermissionError

type PermissionError struct {
	Resource string
	Action   string
	Reason   string
}

PermissionError .

func NewPermissionError

func NewPermissionError(resource, action, reason string) *PermissionError

NewPermissionError .

func (*PermissionError) Error

func (e *PermissionError) Error() string

func (*PermissionError) HTTPStatus

func (e *PermissionError) HTTPStatus() int

func (*PermissionError) Translate

func (e *PermissionError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type ServiceInvokingError

type ServiceInvokingError struct {
	Service string
	Cause   error
}

ServiceInvokingError .

func NewServiceInvokingError

func NewServiceInvokingError(service string, err error) *ServiceInvokingError

NewServiceInvokingError .

func (*ServiceInvokingError) Error

func (e *ServiceInvokingError) Error() string

func (*ServiceInvokingError) HTTPStatus

func (e *ServiceInvokingError) HTTPStatus() int

func (*ServiceInvokingError) Translate

type UnauthorizedError

type UnauthorizedError struct {
	Reason string
}

UnauthorizedError .

func NewUnauthorizedError

func NewUnauthorizedError(reason string) *UnauthorizedError

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

func (*UnauthorizedError) HTTPStatus

func (e *UnauthorizedError) HTTPStatus() int

func (*UnauthorizedError) Translate

func (e *UnauthorizedError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type UnimplementedError

type UnimplementedError struct {
	Service string
}

UnimplementedError .

func NewUnimplementedError

func NewUnimplementedError(service string) *UnimplementedError

NewUnimplementedError .

func (*UnimplementedError) Error

func (e *UnimplementedError) Error() string

func (*UnimplementedError) HTTPStatus

func (e *UnimplementedError) HTTPStatus() int

func (*UnimplementedError) Translate

func (e *UnimplementedError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

type WarnError added in v1.5.0

type WarnError struct {
	Code    int64
	Name    string
	Message string
}

WarnError warn error

func NewWarnError added in v1.5.0

func NewWarnError(message string) *WarnError

NewWarnError init warn error

func (*WarnError) Error added in v1.5.0

func (e *WarnError) Error() string

func (*WarnError) HTTPStatus added in v1.5.0

func (e *WarnError) HTTPStatus() int

func (*WarnError) Translate added in v1.5.0

func (e *WarnError) Translate(t i18n.Translator, langs i18n.LanguageCodes) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL