errors

package
v0.0.0-...-4e7898a Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ErrBadRequestCode = 400

ErrBadRequestCode is a string code representing a bad request related error

View Source
const ErrClientClosedRequest = 499

ErrClientClosedRequest is a string code representing the client closed request error

View Source
const ErrInternalCode = 500

ErrInternalCode is a string code representing an internal Pitaya error

View Source
const ErrNotFoundCode = 404

ErrNotFoundCode is a string code representing a not found related error

View Source
const ErrUnknownCode = 0001

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

Variables

This section is empty.

Functions

func CodeFromError

func CodeFromError(err error) uint32

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     uint32
	Message  string
	Metadata map[string]string
}

Error is an error with a code, message and metadata

func NewError

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

NewError ctor

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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