errors

package
v1.0.0-beta.114 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	As = errors.As
	Is = errors.Is

	ErrNotFound = fmt.Errorf("not found")
)

Functions

func Aborted

func Aborted(format string, args ...any) error

Aborted constructs conflict error (HTTP: 409).

func AlreadyExists

func AlreadyExists(format string, args ...any) error

AlreadyExists construct conflict error (HTTP: 409).

func ContentTooLarge

func ContentTooLarge(format string, args ...any) error

ContentTooLarge constructs content too large error (HTTP: 413).

func DeadlineExceeded

func DeadlineExceeded(format string, args ...any) error

DeadlineExceeded constructs timeout error (HTTP: 504).

func Errorf

func Errorf(c WSErrorCode, format string, a ...any) *api.ErrorEvent

func Internal

func Internal(format string, args ...any) error

Internal constructs internal server error (HTTP: 500).

func InternalWS

func InternalWS(format string, args ...any) *api.ErrorEvent

func InvalidArgument

func InvalidArgument(format string, args ...any) error

InvalidArgument constructs bad request error (HTTP: 400).

func MethodNotAllowed

func MethodNotAllowed(format string, args ...any) error

MethodNotAllowed constructs method not allowed error (HTTP: 405).

func NotFound

func NotFound(format string, args ...any) error

NotFound constructs not found error (HTTP: 404).

func PermissionDenied

func PermissionDenied(format string, args ...any) error

PermissionDenied constructs forbidden error (HTTP: 403).

func ResourceExhausted

func ResourceExhausted(format string, args ...any) *api.TigrisError

ResourceExhausted constructs too many requests error (HTTP: 429).

func Unauthenticated

func Unauthenticated(format string, args ...any) error

Unauthenticated construct unauthorized error (HTTP: 401).

func Unavailable

func Unavailable(format string, args ...any) error

Unavailable constructs service unavailable error (HTTP: 503).

func Unimplemented

func Unimplemented(format string, args ...any) error

Unimplemented constructs not implemented error (HTTP: 501).

func Unknown

func Unknown(format string, args ...any) error

Unknown constructs internal server error (HTTP: 500).

Types

type WSErrorCode

type WSErrorCode int32
const (
	CodeOK                                   = 0
	CloseNormalClosure           WSErrorCode = 1000
	CloseGoingAway               WSErrorCode = 1001
	CloseProtocolError           WSErrorCode = 1002
	CloseUnsupportedData         WSErrorCode = 1003
	CloseNoStatusReceived        WSErrorCode = 1005
	CloseAbnormalClosure         WSErrorCode = 1006
	CloseInvalidFramePayloadData WSErrorCode = 1007
	ClosePolicyViolation         WSErrorCode = 1008
	CloseMessageTooBig           WSErrorCode = 1009
	CloseMandatoryExtension      WSErrorCode = 1010
	CloseInternalServerErr       WSErrorCode = 1011
	CloseServiceRestart          WSErrorCode = 1012
	CloseTryAgainLater           WSErrorCode = 1013
	CloseTLSHandshake            WSErrorCode = 1015
)

Jump to

Keyboard shortcuts

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