yotierror

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// InvalidTokenError means that the token used to call GetActivityDetails is invalid. Make sure you are retrieving this token correctly.
	InvalidTokenError = errors.New("invalid token")

	// TokenDecryptError means that the token could not be decrypted. Ensure you are using the correct .pem file.
	TokenDecryptError = errors.New("unable to decrypt token")

	// SharingFailureError means that the share between a user and an application was not successful.
	SharingFailureError = DetailedSharingFailureError{}
)
View Source
var (

	// DefaultHTTPErrorMessages maps HTTP error status codes to format strings
	// to create useful error messages. -1 is used to specify a default message
	// that can be used if an error code is not explicitly defined
	DefaultHTTPErrorMessages = map[int]string{
		-1: defaultUnknownErrorMessageConst,
	}
)

Functions

This section is empty.

Types

type DataObject

type DataObject struct {
	Code    string           `json:"code"`
	Message string           `json:"message"`
	Errors  []ItemDataObject `json:"errors,omitempty"`
}

DataObject maps from JSON error responses

type DetailedSharingFailureError added in v3.6.0

type DetailedSharingFailureError struct {
	Code        *string
	Description *string
}

func (DetailedSharingFailureError) Error added in v3.6.0

type Error

type Error struct {
	Err      error
	Response *http.Response
	// contains filtered or unexported fields
}

Error indicates errors related to the Yoti API.

func NewResponseError

func NewResponseError(response *http.Response, httpErrorMessages ...map[int]string) *Error

NewResponseError creates a new Error

func (Error) Error

func (e Error) Error() string

Error return the error message

func (Error) Temporary

func (e Error) Temporary() bool

Temporary indicates this error is a temporary error

type ItemDataObject

type ItemDataObject struct {
	Message  string `json:"message"`
	Property string `json:"property"`
}

ItemDataObject maps from JSON error items

type MultiError

type MultiError struct {
	This error
	Next error
}

MultiError wraps one or more errors into a single error

func (MultiError) Error

func (e MultiError) Error() string

func (MultiError) Unwrap

func (e MultiError) Unwrap() error

Unwrap the next error

Jump to

Keyboard shortcuts

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