errors

package
v0.0.0-...-663eb47 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrJWTParsingFailed represents an error that occurs when the parsing of a
	// JSON Web Token fails, generally due to malformed structure or incorrect data
	// within the token itself. This error indicates that the token could not be
	// processed as expected.
	ErrJWTParsingFailed = fmt.Errorf("JWT parsing failed")

	// ErrJWTClaimNotFound represents an error that occurs when a specific claim is
	// expected within a JSON Web Token but is not present. This indicates that the
	// token lacks certain required information.
	ErrJWTClaimNotFound = fmt.Errorf("claim not found")

	// ErrJWTEmptyToken indicates the absence of a JSON Web Token when one was
	// expected, often implying a missing authentication credential in a request.
	ErrJWTEmptyToken = fmt.Errorf("token is empty")

	// ErrSignatureMismatch indicates a discrepancy between the expected signature
	// and the actual signature of a JSON Web Token (JWT), suggesting that the token
	// may have been altered or that there is an error in how the signature was
	// generated. It is commonly encountered during the validation process of a JWT.
	ErrSignatureMismatch = fmt.Errorf("signature mismatch")

	// ErrInvalidSignature represents an error encountered when the signature of a
	// JSON Web Token (JWT) fails to validate during the verification process,
	// indicating potential tampering or corruption of the token.
	ErrInvalidSignature = fmt.Errorf("invalid signature")
)
View Source
var ErrInvalidEnv = fmt.Errorf("invalid environment variable")

ErrInvalidEnv represents an error that occurs when an environment variable fails to meet the required format or constraints for the application's correct operation, indicating non-compliance with the necessary criteria.

View Source
var ErrInvalidPath = fmt.Errorf("invalid path")

ErrInvalidPath represents an error that occurs when a provided path is not valid or does not adhere to the expected format, structure, or syntax necessary for proper processing or functioning within an application.

View Source
var ErrMissingEnv = fmt.Errorf("missing environment variable")

ErrMissingEnv represents the error condition where a required environment variable is not present in the environment. This typically indicates that the application configuration or execution cannot proceed without this variable being set.

View Source
var ErrObjectStorageDownload = fmt.Errorf("error downloading data from object storage")

ErrObjectStorageDownload represents an error encountered when attempting to retrieve data from an object storage service. This may be due to network disruptions, access permission problems, or other unforeseen factors that interfere with the ability to download the desired content.

View Source
var ErrObjectStorageUpload = fmt.Errorf("error uploading data to object storage")

ErrObjectStorageUpload represents an error that occurs when there is a failure to upload data to an object storage service. This may be due to issues like network connectivity, access permissions, or other conditions that prevent successful data transfer to the storage service.

View Source
var ErrPCMForwarding = fmt.Errorf("error forwarding reports to pcm")

ErrPCMForwarding represents an error that occurs during the forwarding of reports to PCM. This error typically arises from issues with data transmission or communication problems with PCM, hindering the successful delivery of reports.

View Source
var ErrRequestBodyReading = fmt.Errorf("error reading request body")

ErrRequestBodyReading represents an error encountered when trying to read the body of an HTTP request. It is used to indicate difficulties in obtaining request data, which may arise from network issues, improperly formatted input, or a premature end of the data stream.

View Source
var ErrRequestHandling = fmt.Errorf("error handling request")

ErrRequestHandling represents the occurrence of an error during the processing of an HTTP request, indicating that the request could not be handled as expected due to either a malfunction in the request handling logic or an unforeseen issue arising while fulfilling the request.

View Source
var ErrRequestParsing = fmt.Errorf("error parsing request")

ErrRequestParsing represents the error that occurs when the format or structure of an incoming request cannot be interpreted. This usually means the request does not match the expected schema or is malformed, obstructing proper processing.

View Source
var ErrResponseParsing = fmt.Errorf("error parsing response")

ErrResponseParsing signifies a failure in interpreting a received response when there is a mismatch between the expected data format and the actual structure encountered.

View Source
var ErrResponseWriting = fmt.Errorf("error writing response")

ErrResponseWriting indicates an error encountered during the process of sending an HTTP response back to the client. It is used to signal failure in the response transmission which can arise from various issues such as network failures, encoding errors, or interruptions in the data stream to the client.

Functions

func As

func As(err error, target any) bool

As attempts to assign an [error] to a target of any interface type, checking if the error can be represented as the target's type. It returns true if the assignment is successful or false otherwise. The target must be a non-nil pointer to the type that may represent the [error]. If the target is not a non-nil pointer or does not conform to the appropriate type, a panic will occur.

func Is

func Is(err, target error) bool

Is reports whether any [error] in err's chain matches target, considering wrapped errors and allowing for comparison of the underlying error values.

func New

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

New creates a new error with the specified message and returns an [error]. If the message is empty, the returned error will have an empty message string.

func Wrap

func Wrap(errl ...error) error

Wrap consolidates a sequence of [error]s into a single [error], streamlining error handling by combining multiple errors into one. It returns nil if there is no error to wrap, indicated by the last [error] in the sequence being nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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