errors

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(msg interface{}, code int)

func GetDefaultErrorHandler

func GetDefaultErrorHandler() func(msg interface{}, code int)

func SetDefaultErrorHandler

func SetDefaultErrorHandler()

func SetErrorHandler

func SetErrorHandler(handler func(msg interface{}, code int))

Types

type HTTPError

type HTTPError struct {
	Code       int                 `json:"code,omitempty"`
	Type       string              `json:"type"`
	Title      string              `json:"title"`
	Detail     string              `json:"detail"`
	Violations []map[string]string `json:"violations"`
}

func NewHTTPError

func NewHTTPError(response *resty.Response) (err *HTTPError)

func (*HTTPError) Error

func (err *HTTPError) Error() string

type InvalidDomainError

type InvalidDomainError struct {
	Domain       string
	ValidDomains []string
}

func NewInvalidDomainError

func NewInvalidDomainError(validDomains []string, domain string) *InvalidDomainError

func (*InvalidDomainError) Error

func (err *InvalidDomainError) Error() string

Jump to

Keyboard shortcuts

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