Documentation ¶
Index ¶
- Constants
- func Cause(err error) error
- func IsAppError(err error, code string) bool
- func Repo(err error, mainTable string) error
- func Wrap(err error, messages ...string) error
- type AggregatedError
- type AppError
- func NewAppBadGatewayError() AppError
- func NewAppBadRequestError(message string) AppError
- func NewAppConflictError(field string) AppError
- func NewAppForbiddenError() AppError
- func NewAppGatewayTimeoutError() AppError
- func NewAppInternalServerError() AppError
- func NewAppNotFoundError(field string) AppError
- func NewAppUnauthorizedError() AppError
- func NewAppUnprocessableEntityError(message string) AppError
- func NewEmptyParameterError(field string) AppError
- func NewEmptyPathError(field string) AppError
- func NewInvalidLoginError() AppError
- func NewInvalidUserError() AppError
- type WrappedError
Constants ¶
const ErrorCodeBadGateway = "bad-gateway"
ErrorCodeBadGateway means that an HTTP Bad Gateway occurred
const ErrorCodeBadRequest = "bad-request"
ErrorCodeBadRequest indicates that the request sent to the server is invalid or corrupted
const ErrorCodeConflict = "conflict"
ErrorCodeConflict means the resource conflicts with an existing one
const ErrorCodeEmptyParameter = "empty-parameter"
ErrorCodeEmptyParameter means that parameter is empty
const ErrorCodeEmptyPath = "empty-path"
ErrorCodeEmptyPath means that path is empty
const ErrorCodeForbidden = "forbidden"
ErrorCodeForbidden means user not having the necessary permissions for a resource
const ErrorCodeGatewayTimeout = "gateway-timeout"
ErrorCodeBadGateway means that server was acting as a gateway or proxy and did not receive a timely response from the upstream server
const ErrorCodeInternalServerError = "internal-server-error"
ErrorCodeInternalServerError means an unexpected condition was encountered and no more specific message is suitable
const ErrorCodeInvalidLogin = "invalid-login"
ErrorCodeInvalidLogin means that path is empty
const ErrorCodeInvalidUser = "invalid-user"
ErrorCodeInvalidUser means that user is invalid
const ErrorCodeNotFound = "not-found"
ErrorCodeNotFound means the request resource was not found
ErrorCodeUnauthorized means the user wasn't identified
const ErrorCodeUnprocessableEntity = "unprocessable-entity"
ErrorCodeUnprocessableEntity means the action could not be processed properly due to invalid data provided
Variables ¶
This section is empty.
Functions ¶
func IsAppError ¶
Types ¶
type AggregatedError ¶
type AggregatedError []error
func NewAggregatedError ¶
func NewAggregatedError(errs ...error) AggregatedError
func (*AggregatedError) Add ¶
func (e *AggregatedError) Add(err error)
func (*AggregatedError) AddList ¶
func (e *AggregatedError) AddList(err []error)
func (AggregatedError) Error ¶
func (e AggregatedError) Error() string
func (AggregatedError) Len ¶
func (e AggregatedError) Len() int
type AppError ¶
func NewAppBadGatewayError ¶
func NewAppBadGatewayError() AppError
func NewAppBadRequestError ¶
func NewAppConflictError ¶
func NewAppForbiddenError ¶
func NewAppForbiddenError() AppError
func NewAppGatewayTimeoutError ¶
func NewAppGatewayTimeoutError() AppError
func NewAppInternalServerError ¶
func NewAppInternalServerError() AppError
func NewAppNotFoundError ¶
func NewAppUnauthorizedError ¶
func NewAppUnauthorizedError() AppError
func NewEmptyParameterError ¶
func NewEmptyPathError ¶
func NewInvalidLoginError ¶
func NewInvalidLoginError() AppError
func NewInvalidUserError ¶
func NewInvalidUserError() AppError
type WrappedError ¶
type WrappedError struct {
// contains filtered or unexported fields
}
func (WrappedError) Cause ¶
func (e WrappedError) Cause() error
func (WrappedError) Error ¶
func (e WrappedError) Error() string
Source Files ¶
- aggregated.go
- app.go
- bad_gateway_error.go
- bad_request_error.go
- conflict_error.go
- empty_parameter.go
- empty_path.go
- forbidden_error.go
- gateway_timeout_error.go
- internal_server_error.go
- invalid_login.go
- invalid_user.go
- not_found_error.go
- repository.go
- unauthorized_error.go
- unprocessable_entity_error.go
- wrapped.go