errors

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errors package

Index

Constants

View Source
const (
	EInternal        = "internal error"
	ENotImplemented  = "not implemented"
	ENotFound        = "not found"
	EConflict        = "conflict"
	EOptimisticLock  = "optimistic lock"
	EInvalid         = "invalid"
	EForbidden       = "forbidden"
	ETooManyRequests = "too many requests"
	EUnauthorized    = "unauthorized"
	ETooLarge        = "request too large"
)

Error code constants

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) string

ErrorCode returns the code of the root error, if available; otherwise returns EINTERNAL.

func ErrorMessage

func ErrorMessage(err error) string

ErrorMessage returns the messages associated with the error

func WithErrorErr

func WithErrorErr(err error) func(*TharsisError)

WithErrorErr sets the err on the error.

Types

type TharsisError

type TharsisError struct {
	Err  error
	Code string
	Msg  string
}

TharsisError is the internal error implementation for the Tharsis API

func NewError

func NewError(code string, msg string, options ...func(*TharsisError)) *TharsisError

NewError creates an instance of TharsisError

func (*TharsisError) Error

func (e *TharsisError) Error() string

Error implements the error interface by writing out the recursive messages.

Jump to

Keyboard shortcuts

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