errors

package
v0.0.0-...-29a42cb Latest Latest
Warning

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

Go to latest
Published: Nov 21, 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"}

	PokemonsNotFound    = CustomError{Message: "Pokemons not found", Code: 404, InternalCode: "POKEMONS_NOT_FOUND"}
	PokemonAlreadySaved = CustomError{Message: "Pokemon already saved", Code: 400, InternalCode: "POKEMON_ALREADY_SAVED"}
)

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