errors

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadRequestCode = S_Code{
	Desc:      "PIT-400",
	ErrorCode: 400,
}

ErrBadRequestCode is a string code representing a bad request related error

View Source
var ErrClientClosedRequest = S_Code{
	Desc:      "PIT-499",
	ErrorCode: 499,
}

ErrClientClosedRequest is a string code representing the client closed request error

View Source
var ErrInternalCode = S_Code{
	Desc:      "PIT-500",
	ErrorCode: 500,
}

ErrInternalCode is a string code representing an internal Pitaya error

View Source
var ErrNotFoundCode = S_Code{
	Desc:      "PIT-404",
	ErrorCode: 404,
}

ErrNotFoundCode is a string code representing a not found related error

View Source
var ErrUnknownCode = S_Code{
	Desc:      "PIT-450",
	ErrorCode: 450,
}

ErrUnknownCode is a string code representing an unknown error This will be used when no error code is sent by the handler

Functions

func CodeFromError added in v0.9.0

func CodeFromError(err error) string

CodeFromError returns the code of error. If error is nil, return empty string. If error is not a pitaya error, returns unkown code

Types

type Error

type Error struct {
	Code      string
	Message   string
	Metadata  map[string]string
	ErrorCode int32
}

Error is an error with a code, message and metadata

func NewError

func NewError(err error, code string, errorCode int32, metadata ...map[string]string) *Error

NewError ctor

func (*Error) Error

func (e *Error) Error() string

type S_Code added in v1.1.11

type S_Code struct {
	Desc      string
	ErrorCode int32
}

Jump to

Keyboard shortcuts

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