srvcerror

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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