customerrors

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERROR_UNAUTHORISED              = &Error{message: "unauthorised", code: http.StatusUnauthorized}
	ERROR_DATABASE                  = &Error{message: "database operation failed", code: http.StatusFailedDependency}
	ERROR_PERMISSION_DENIED         = &Error{message: "permission denied", code: http.StatusForbidden}
	ERROR_DATABASE_UNIQUE_KEY       = &Error{message: "unique key failed", code: http.StatusBadRequest}
	ERROR_DATABASE_RECORD_NOT_FOUND = &Error{message: "record not found", code: http.StatusNotFound}
	ERROR_INTERNAL_SERVER_ERROR     = &Error{message: "internal server error", code: http.StatusInternalServerError}
)

Functions

func BAD_REQUEST_ERROR

func BAD_REQUEST_ERROR(message string, args ...any) error

func New added in v1.0.8

func New(code int, message string, args ...any) error

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Code

func (e *Error) Code() int

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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