errors

package
v0.0.0-...-d18dbcb Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Custom

func Custom() *errorBuilder

func GenerateByStatusCode

func GenerateByStatusCode(code int) *errorBuilder

func InternalServerError

func InternalServerError() *errorBuilder

func InvalidRequest

func InvalidRequest() *errorBuilder

func NotAllowed

func NotAllowed() *errorBuilder

func NotFound

func NotFound() *errorBuilder

func ServiceNotAvailable

func ServiceNotAvailable() *errorBuilder

func Unauthorized

func Unauthorized() *errorBuilder

Types

type ErrorMessage

type ErrorMessage struct {
	ErrorCode    string `json:"error_code"`
	ErrorMessage string `json:"error_message"`
}

type ErrorResponse

type ErrorResponse struct {
	HTTPStatusCode int          `json:"status"`
	ErrorMessage   ErrorMessage `json:"error"`
}

type ErrorType

type ErrorType string
const (
	ErrInvalidRequest      ErrorType = "INVALID_REQUEST"
	ErrUnauthorized        ErrorType = "UNAUTHORIZED"
	ErrNotFound            ErrorType = "NOT_FOUND"
	ErrNotAllowed          ErrorType = "NOT_ALLOWED"
	ErrInternalServerError ErrorType = "INTERNAL_SERVER_ERROR"
	ErrServiceUnavailable  ErrorType = "SERVICE_UNAVAILABLE"
)

Jump to

Keyboard shortcuts

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