errors

package
v0.0.0-...-54a0447 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIUserFault byte = iota
	APIUserFaultNeedsLog
	APIServerFault
	APITimedOut
	APINoCapacity
	APIUnexpectedValue
	APIDatabaseFailed
)
View Source
const (
	MessageKeyInvalidatedDueToMalice = "" /* 136-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// Type is a uint8 that specifies the error type. If at any time, an error's type is
	// set to zero - it means we may not handle the error properly and it should be looked into.
	Type byte
	// Message is the message of the error.
	Message string
	// Underlying is the error that may have caused this error to be created. This is mainly used
	// when a function recovers, and we don't know what type the recover is.
	Underlying any
}

APIError is the underlying error struct for when the API encounters an error.

func New

func New(t byte, msg string, uErr any) *APIError

New returns a new APIError

func (*APIError) Error

func (err *APIError) Error() string

func (*APIError) StatusCode

func (err *APIError) StatusCode() int

Jump to

Keyboard shortcuts

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