errors

package
v0.0.0-...-f23880e Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomError

type CustomError struct {
	Code    ErrorCode
	Message string
}

func New

func New(code ErrorCode, message string) CustomError

func Newf

func Newf(code ErrorCode, format string, args ...any) CustomError

func (*CustomError) Error

func (e *CustomError) Error() string

func (*CustomError) GetCode

func (e *CustomError) GetCode() ErrorCode

type ErrorCode

type ErrorCode string
const (
	ErrorCodeInternalError      ErrorCode = "internal_error"
	ErrorCodePreconditionFailed ErrorCode = "precondition_failed"
	ErrorCodeForbidden          ErrorCode = "forbidden"
	ErrorCodeNotFound           ErrorCode = "not_found"
	ErrorCodeBadRequest         ErrorCode = "bad_request"
)

Jump to

Keyboard shortcuts

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