errors

package
v0.0.0-...-03b02e1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorCodeBadGateway = "bad-gateway"

ErrorCodeBadGateway means that an HTTP Bad Gateway occurred

View Source
const ErrorCodeBadRequest = "bad-request"

ErrorCodeBadRequest indicates that the request sent to the server is invalid or corrupted

View Source
const ErrorCodeConflict = "conflict"

ErrorCodeConflict means the resource conflicts with an existing one

View Source
const ErrorCodeEmptyParameter = "empty-parameter"

ErrorCodeEmptyParameter means that parameter is empty

View Source
const ErrorCodeEmptyPath = "empty-path"

ErrorCodeEmptyPath means that path is empty

View Source
const ErrorCodeForbidden = "forbidden"

ErrorCodeForbidden means user not having the necessary permissions for a resource

View Source
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

View Source
const ErrorCodeInternalServerError = "internal-server-error"

ErrorCodeInternalServerError means an unexpected condition was encountered and no more specific message is suitable

View Source
const ErrorCodeInvalidLogin = "invalid-login"

ErrorCodeInvalidLogin means that path is empty

View Source
const ErrorCodeInvalidUser = "invalid-user"

ErrorCodeInvalidUser means that user is invalid

View Source
const ErrorCodeNotFound = "not-found"

ErrorCodeNotFound means the request resource was not found

View Source
const ErrorCodeUnauthorized = "unauthorized"

ErrorCodeUnauthorized means the user wasn't identified

View Source
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 Cause

func Cause(err error) error

func IsAppError

func IsAppError(err error, code string) bool

func Repo

func Repo(err error, mainTable string) error

func Wrap

func Wrap(err error, messages ...string) error

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

type AppError struct {
	StatusCode int
	Code       string
	Field      string
	Message    string
}

func NewAppBadGatewayError

func NewAppBadGatewayError() AppError

func NewAppBadRequestError

func NewAppBadRequestError(message string) AppError

func NewAppConflictError

func NewAppConflictError(field string) AppError

func NewAppForbiddenError

func NewAppForbiddenError() AppError

func NewAppGatewayTimeoutError

func NewAppGatewayTimeoutError() AppError

func NewAppInternalServerError

func NewAppInternalServerError() AppError

func NewAppNotFoundError

func NewAppNotFoundError(field string) AppError

func NewAppUnauthorizedError

func NewAppUnauthorizedError() AppError

func NewAppUnprocessableEntityError

func NewAppUnprocessableEntityError(message string) AppError

func NewEmptyParameterError

func NewEmptyParameterError(field string) AppError

func NewEmptyPathError

func NewEmptyPathError(field string) AppError

func NewInvalidLoginError

func NewInvalidLoginError() AppError

func NewInvalidUserError

func NewInvalidUserError() AppError

func (AppError) Error

func (e AppError) Error() string

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

Jump to

Keyboard shortcuts

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