errors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBadRequestError

func IsBadRequestError(err error) bool

IsBadRequestError verify if an error is a BadRequestError

func IsExpiredResourceError

func IsExpiredResourceError(err error) bool

IsExpiresResourceError verify if an error is a ExpiredResourceError

func IsInternalServerError

func IsInternalServerError(err error) bool

IsInternalServerError verify if an error is a InternalServerError

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError verify if an error is a NotFoundError

func IsOutdatedResourceError

func IsOutdatedResourceError(err error) bool

IsResourceAlreadyCreatedError verify if an error is a ResourceAlreadyCreatedError

func IsResourceAlreadyCreatedError

func IsResourceAlreadyCreatedError(err error) bool

IsResourceAlreadyCreatedError verify if an error is a ResourceAlreadyCreatedError

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

IsUnauthorizedError verify if an error is a UnauthorizedError

func NewBadRequestError

func NewBadRequestError(key string) error

NewBadRequestError return a new BadRequestError

func NewExpiredResourceError

func NewExpiredResourceError(key string) error

NewExpiredResourceError return a new ExpiredResourceError

func NewInternalServerError

func NewInternalServerError(key string) error

NewInternalServerError return a new InternalServerError

func NewNotFoundError

func NewNotFoundError(key string) error

NewNotFoundError return a new NotFoundError

func NewOutdatedResourceError

func NewOutdatedResourceError(key string) error

NewOutdatedResourceError return a new OutdatedResourceError

func NewResourceAlreadyCreatedError

func NewResourceAlreadyCreatedError(key string) error

NewResourceAlreadyExist return a new ResourceAlreadyExist

func NewUnauthorizedError

func NewUnauthorizedError(key string, subjectAndMessage ...string) error

NewUnauthorizedError return a new UnauthorizedError

Types

type BadRequestError

type BadRequestError struct {
	ErrorWithKey
}

BadRequestError is used when the given parameters does not match requirements

type ErrorWithKey

type ErrorWithKey struct {
	Key string
}

func (*ErrorWithKey) Error

func (e *ErrorWithKey) Error() string

type ExpiredResourceError

type ExpiredResourceError struct {
	ErrorWithKey
}

ExpiresResourceError is used when the given resource has expired

type InternalServerError

type InternalServerError struct {
	ErrorWithKey
}

InternalServerError is used when an error unexpected appears

type NotFoundError

type NotFoundError struct {
	ErrorWithKey
}

NotFoundError is used when we cannot find a specified resource

type OutdatedResourceError

type OutdatedResourceError struct {
	ErrorWithKey
}

ResourceAlreadyCreatedError is used when a resource already exist and could not be created another time

type ResourceAlreadyCreatedError

type ResourceAlreadyCreatedError struct {
	ErrorWithKey
}

ResourceAlreadyCreatedError is used when a resource already exist and could not be created another time

type UnauthorizedError

type UnauthorizedError struct {
	ErrorWithKey
}

UnauthorizedError is used when action is not authorized

Jump to

Keyboard shortcuts

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