errorz

package
v0.0.0-...-363facf Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category string
const (
	APIError            Category = "API_ERROR"
	InvalidRequestError Category = "INVALID_REQUEST_ERROR"
)

type Code

type Code string
const (
	InvalidValue             Code = "INVALID_VALUE"
	InvalidJSONBody          Code = "INVALID_JSON_BODY"
	MissingRequiredParameter Code = "MISSING_REQUIRED_PARAMETER"
	NotFound                 Code = "NOT_FOUND"
	ServiceUnavailable       Code = "SERVICE_UNAVAILABLE"
	IdempotencyKeyInUse      Code = "IDEMPOTENCY_KEY_IN_USE"
	InvalidTransaction       Code = "INVALID_TRANSACTION"
)

type DocURL

type DocURL string
const (
	APIDocURL DocURL = "https://google.ca"
)

type Field

type Field struct {
	Category Category `json:"category"`
	Code     Code     `json:"code"`
	DocURL   DocURL   `json:"doc_url"`
	Message  string   `json:"message"`
}

type Response

type Response struct {
	ErrorFields []Field `json:"errors"`
}

func NewIdemKeyError

func NewIdemKeyError(err error) Response

func NewInternalError

func NewInternalError(err error) Response

func NewInvalidJSONError

func NewInvalidJSONError(err error) Response

func NewInvalidValueError

func NewInvalidValueError(err error) Response

func NewNotFoundError

func NewNotFoundError(err error) Response

func NewTransactionError

func NewTransactionError(err error) Response

func NewValidationError

func NewValidationError(errs validator.ValidationErrors) Response

Jump to

Keyboard shortcuts

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