errors

package
v0.0.0-...-996fa4a Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRequest      = &Error{Status: 400, Message: "the request was invalid or cannot be otherwise served"}
	ErrUnauthorized    = &Error{Status: 401, Message: "the security key provided is not authorized to perform this operation"}
	ErrPaymentRequired = &Error{Status: 402, Message: "the request can not be served, as the payment is required to proceed"}
	ErrForbidden       = &Error{Status: 403, Message: "the request is understood, but it has been refused or access is not allowed"}
	ErrNotFound        = &Error{Status: 404, Message: "the resource requested does not exist"}
	ErrServerError     = &Error{Status: 500, Message: "an unexpected condition was encountered and no more specific message is suitable"}
	ErrNotImplemented  = &Error{Status: 501, Message: "the server either does not recognize the request method, or it lacks the ability to fulfill the request"}
	ErrTargetInvalid   = &Error{Status: 400, Message: "channel should end with `/` for strict types or `/#/` for wildcards"}
	ErrTargetTooLong   = &Error{Status: 400, Message: "channel can not have more than 23 parts"}
	ErrLinkInvalid     = &Error{Status: 400, Message: "the link must be an alphanumeric string of 1 or 2 characters"}
	ErrUnauthorizedExt = &Error{Status: 401, Message: "the security key with extend permission can only be used for private links"}
)

Represents a set of errors used in the handlers.

Functions

This section is empty.

Types

type Error

type Error struct {
	Request uint16 `json:"req,omitempty"`
	Status  int    `json:"status"`
	Message string `json:"message"`
}

Error represents an event code which provides a more details.

func New

func New(msg string) *Error

New creates a new error

func (*Error) Copy

func (e *Error) Copy() *Error

Copy clones the error object.

func (*Error) Error

func (e *Error) Error() string

Error implements error interface.

func (*Error) ForRequest

func (e *Error) ForRequest(requestID uint16)

ForRequest returns an error for a specific request.

Jump to

Keyboard shortcuts

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