apierrors

package
v0.5.0-alpha.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPErrorHandler

func HTTPErrorHandler(logger *logger.Logger, err error, c echo.Context) error

HTTPErrorHandler must be hooked to an echo server to render instances of HTTPError as JSON

Types

type GenericError

type GenericError struct {
	Error string
}

type HTTPError

type HTTPError struct {
	HTTPCode        int
	Message         interface{}
	AdditionalError string
}

func BodyIsEmptyError

func BodyIsEmptyError() *HTTPError

func ChainNotFoundError

func ChainNotFoundError(chainID string) *HTTPError

func ContractExecutionError

func ContractExecutionError(err error) *HTTPError

func HTTPErrorFromEchoError

func HTTPErrorFromEchoError(httpError *echo.HTTPError) *HTTPError

func InternalServerError

func InternalServerError(err error) *HTTPError

func InvalidOffLedgerRequestError

func InvalidOffLedgerRequestError(err error) *HTTPError

func InvalidPeerName

func InvalidPeerName() *HTTPError

func InvalidPeerPublicKeys

func InvalidPeerPublicKeys(invalidPeerPubKeys []string) *HTTPError

func InvalidPropertyError

func InvalidPropertyError(propertyName string, err error) *HTTPError

func NewHTTPError

func NewHTTPError(httpCode int, message interface{}, err error) *HTTPError

func NoRecordFoundErrror

func NoRecordFoundErrror(err error) *HTTPError

func PeerNameNotFoundError

func PeerNameNotFoundError(name string) *HTTPError

func ReceiptError

func ReceiptError(err error) *HTTPError

func SelfAsPeerError

func SelfAsPeerError() *HTTPError

func UserCanNotBeDeleted

func UserCanNotBeDeleted(username string, explanation string) *HTTPError

func UserNotFoundError

func UserNotFoundError(username string) *HTTPError

func (*HTTPError) Error

func (he *HTTPError) Error() string

func (*HTTPError) GetErrorResult

func (he *HTTPError) GetErrorResult() *HTTPErrorResult

type HTTPErrorResult

type HTTPErrorResult struct {
	Message interface{}
	Error   string
}

Jump to

Keyboard shortcuts

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