exception

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadRequest   = New(http.StatusBadRequest, "Bad Request")
	Unauthorized = New(http.StatusUnauthorized, "Unauthorized")
	Forbidden    = New(http.StatusForbidden, "Forbidden")
	NotFound     = New(http.StatusNotFound, "Resource Not Found")
	SystemError  = New(http.StatusInternalServerError, "System Error")
)

Functions

This section is empty.

Types

type Exception

type Exception interface {

	// Code returns error code
	Code() uint

	// Message return the simple message
	Message() string

	// Error returns detailed error message
	Error() string
}

func New

func New(code uint, message string) Exception

New returns a new error instance

func NewWithCause

func NewWithCause(cause Exception, message string) Exception

Jump to

Keyboard shortcuts

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