apierror

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: AGPL-3.0 Imports: 2 Imported by: 51

README

apierror

A common package for mapping API errors.

Author

E Camden Fisher camden.fisher@yale.edu

License

GNU Affero General Public License v3.0 (GNU AGPLv3) Copyright (c) 2020 Yale University

Documentation

Index

Constants

View Source
const ErrBadRequest = "BadRequest"

ErrBadRequest indicates a bad request or input

View Source
const ErrConflict = "Conflict"

ErrConflict indicates a conflict with an existing resource

View Source
const ErrForbidden = "Forbidden"

ErrForbidden indicates a lack of permissions for the given resource

View Source
const ErrInternalError = "InternalError"

ErrInternalError indicates an unknown internal error occurred

View Source
const ErrLimitExceeded = "LimitExceeded"

ErrLimitExceeded indicates a service or rate limit has been exceeded

View Source
const ErrNotFound = "NotFound"

ErrNotFound indicates a the requested object is missing/not found

View Source
const ErrServiceUnavailable = "ServiceUnavailable"

ErrServiceUnavailable indicates an internal or external service is not available

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    string
	Message string
	OrigErr error
}

Error wraps lower level errors with code, message and an original error. This is modelled after the awserr with the intention of standardizing the output.

func New

func New(code, message string, err error) Error

New constructs an Error and returns it as an error

func (Error) Error

func (e Error) Error() string

Error Satisfies the Error interface

func (Error) String

func (e Error) String() string

String returns the error as string

func (Error) Unwrap added in v0.1.3

func (e Error) Unwrap() error

Jump to

Keyboard shortcuts

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