errors

package
v0.0.0-...-f5b340a Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Traceable

type Traceable struct {
	ErrorType TraceableType `json:"error_type"`
	Message   string        `json:"message"`
	Cause     error         `json:"cause"`
}

Traceable contains all the details and error stack

func NewTraceable

func NewTraceable(errorType TraceableType, message string, originError error) *Traceable

NewTraceable constructor for Traceable error

func (Traceable) Error

func (e Traceable) Error() string

Error interface implementation

func (Traceable) StackTrace

func (e Traceable) StackTrace() string

StackTrace print the stacktrace for the current error

type TraceableType

type TraceableType string

TraceableType type alias for string

const (
	NotFound     TraceableType = "NotFound"
	CreateError  TraceableType = "CreateError"
	UpdateError  TraceableType = "UpdateError"
	DeleteError  TraceableType = "DeleteError"
	BadRequest   TraceableType = "BadRequest"
	Unauthorized TraceableType = "Unauthorized"
	TypeMismatch TraceableType = "TypeMismatch"
)

Jump to

Keyboard shortcuts

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