apierrors

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAPIError

func HandleAPIError(
	config *config.Config,
	w http.ResponseWriter,
	r *http.Request,
	err RequestError,
)

Types

type ErrForbidden

type ErrForbidden struct {
	// contains filtered or unexported fields
}

func (*ErrForbidden) Error

func (e *ErrForbidden) Error() string

func (*ErrForbidden) ExternalError

func (e *ErrForbidden) ExternalError() string

func (*ErrForbidden) GetStatusCode

func (e *ErrForbidden) GetStatusCode() int

func (*ErrForbidden) InternalError

func (e *ErrForbidden) InternalError() string

type ErrInternal

type ErrInternal struct {
	// contains filtered or unexported fields
}

func (*ErrInternal) Error

func (e *ErrInternal) Error() string

func (*ErrInternal) ExternalError

func (e *ErrInternal) ExternalError() string

func (*ErrInternal) GetStatusCode

func (e *ErrInternal) GetStatusCode() int

func (*ErrInternal) InternalError

func (e *ErrInternal) InternalError() string

type ErrPassThroughToClient

type ErrPassThroughToClient struct {
	// contains filtered or unexported fields
}

errors that should be passed directly, with no filter

func (*ErrPassThroughToClient) Error

func (e *ErrPassThroughToClient) Error() string

func (*ErrPassThroughToClient) ExternalError

func (e *ErrPassThroughToClient) ExternalError() string

func (*ErrPassThroughToClient) GetStatusCode

func (e *ErrPassThroughToClient) GetStatusCode() int

func (*ErrPassThroughToClient) InternalError

func (e *ErrPassThroughToClient) InternalError() string

type RequestError

type RequestError interface {
	Error() string
	ExternalError() string
	InternalError() string
	GetStatusCode() int
}

func NewErrForbidden

func NewErrForbidden(err error) RequestError

func NewErrInternal

func NewErrInternal(err error) RequestError

func NewErrPassThroughToClient

func NewErrPassThroughToClient(err error, statusCode int) RequestError

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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