errors

package
v0.0.0-...-1e16040 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadRequest    = CustomError{Message: "BadRequest", Code: 400, InternalCode: "BADREQUEST"}
	Unauthorized  = CustomError{Message: "Unauthorized", Code: 401, InternalCode: "UNAUTHORIZED"}
	NotFound      = CustomError{Message: "NotFound", Code: 404, InternalCode: "NOT_FOUND"}
	InternalError = CustomError{Message: "Error", Code: 500, InternalCode: "INTERNAL_SERVER_ERROR"}

	CurrencyInvalidCharacter = CustomError{Message: "Currency it's contains 3 characters almost", Code: 400, InternalCode: "CURRENCY_CHAR_ERROR"}
	CurrencyInvalidName      = CustomError{Message: "Currency error name", Code: 400, InternalCode: "CURRENCY_INVALID_ERROR"}

	TimeoutErrorApi = CustomError{Message: "Timeout on the call of the api", Code: 504, InternalCode: "TIMEOUT_API"}
)

Functions

This section is empty.

Types

type CustomError

type CustomError struct {
	Message      string `json:"message"`
	Code         int    `json:"code"`
	InternalCode string `json:"internalCode"`
}

CustomError custom error

func (CustomError) Error

func (e CustomError) Error() string

func (CustomError) SetMessage

func (e CustomError) SetMessage(msg string) CustomError

Jump to

Keyboard shortcuts

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