package errors

import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"

Index

Functions

func As

func As(err error, target interface{}) bool

As finds the first error in errors chain that matches target, and if so, sets target to that error value and returns true. Otherwise, it returns false.

func Is

func Is(err, target error) bool

Is reports whether any error in errors chain matches target.

func New

func New(text string) error

New is equivalent to errors.New().

func Verbose

func Verbose(err error) string

Verbose prints the most verbose error that the error message has.

Types

type CallErr

type CallErr struct {
	Req *http.Request
	// Resp contains response body
	Resp *http.Response
	Err  error
}

CallErr represents an HTTP call error. Has a Verbose() method that allows getting the http.Request and Response objects. Implements error.

func (CallErr) Error

func (e CallErr) Error() string

Errors implements error.Error().

func (CallErr) Verbose

func (e CallErr) Verbose() string

Verbose prints a versbose error message with the request or response.

type InvalidJsonErr

type InvalidJsonErr struct {
	Err error
}

func (InvalidJsonErr) Error

func (e InvalidJsonErr) Error() string

Errors implements error.Error().

Source Files

errors.go

Version
v1.4.2 (latest)
Published
Mar 26, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
2 days ago

Tools for package owners.