srvcerror

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeInternalServerError = "internal_server_error"

Variables

View Source
var ErrInternalServerError = New(
	ErrCodeInternalServerError,
	"iekšēja servera kļūda",
).SetHttpStatusCode(http.StatusInternalServerError)

Functions

func Is

func Is(err error, code string) bool

Types

type E

type E interface {
	error
	Is(err error) bool

	ErrorCode() string // unique identifier for the type of underlying cause

	HttpStatusCode() int
	SetHttpStatusCode(code int) E
}

func InternalServerError

func InternalServerError() E

func New

func New(errorCode string, msgToUser string) E

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error implements the E interface

func (Error) Error

func (e Error) Error() string

func (Error) ErrorCode

func (e Error) ErrorCode() string

func (Error) HttpStatusCode

func (e Error) HttpStatusCode() int

func (Error) Is

func (e Error) Is(err error) bool

func (Error) SetHttpStatusCode

func (e Error) SetHttpStatusCode(code int) E

Jump to

Keyboard shortcuts

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