customerrors

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

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

This section is empty.

Types

type Error

type Error struct {
	Message string
	Code    int
}

func BAD_REQUEST_ERROR

func BAD_REQUEST_ERROR(message string, args ...any) *Error

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