errors

package
v0.0.0-...-e6503be Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoType no typed error.
	NoType = ErrorType(iota)
	// BadRequest the server was unable to process the request sent by the client due to invalid syntax.
	BadRequest
	// NotFound the server could not find what was requested.
	NotFound
	// Conflict indicates that the request could not be processed because of conflict in the request,
	// such as an edit conflict in the case of multiple updates.
	Conflict
)

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause gives the original error

func New

func New(msg string) error

New creates a no type error

func Newf

func Newf(msg string, args ...interface{}) error

Newf creates a no type error with formatted message

func Wrap

func Wrap(err error, msg string) error

Wrap wraps an error with a string

func Wrapf

func Wrapf(err error, msg string, args ...interface{}) error

Wrapf wraps an error with format string

Types

type ErrorType

type ErrorType uint

ErrorType holds type of error.

func GetType

func GetType(err error) ErrorType

GetType returns the error type

func (ErrorType) New

func (t ErrorType) New(msg string) error

New creates a new pdnsError

func (ErrorType) Newf

func (t ErrorType) Newf(msg string, args ...interface{}) error

Newf creates a new pdnsError with formatted message

func (ErrorType) Wrap

func (t ErrorType) Wrap(err error, msg string) error

Wrap creates a new wrapped error

func (ErrorType) Wrapf

func (t ErrorType) Wrapf(err error, msg string, args ...interface{}) error

Wrapf creates a new wrapped error with formatted message

Jump to

Keyboard shortcuts

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