errors

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package errors implements functions to manipulate errors.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid           = errors.New("validation failed")
	ErrUnauthorized      = errors.New("access denied")
	ErrForbidden         = errors.New("forbidden")
	ErrNotFound          = errors.New("not found")
	ErrInternal          = errors.New("internal system error")
	ErrTemporaryDisabled = errors.New("temporary disabled")
	ErrTimeout           = errors.New("timeout")
)

Application errors

Functions

This section is empty.

Types

type AppError

type AppError struct {
	// contains filtered or unexported fields
}

func New

func New(message string) *AppError

New returns new app error that formats as the given text.

func Wrap

func Wrap(err error) *AppError

Wrap returns new app error wrapping target error. If passed value is nil will fallback to internal

func (*AppError) Error

func (e *AppError) Error() string

Error returns the string representation of the error message.

func (*AppError) StackTrace

func (e *AppError) StackTrace() string

StackTrace returns the string slice of the error stack traces

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

Jump to

Keyboard shortcuts

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