Categorygithub.com/PlayerR9/go-errors
modulepackage
0.1.5
Repository: https://github.com/playerr9/go-errors.git
Documentation: pkg.go.dev

# README

errors

A Go package for dealing with generalized errors.

# Packages

No description provided by the author

# Functions

As returns the error if it is of type T.
AsWithCode returns the error if it is of type T.
DisplayError displays the complete error to the writer.
Is is function that checks if an error is of type T.
Merge merges the inner Info into the outer Info.
No description provided by the author
New creates a new error.
NewErrAfter creates a new error.Err error.
NewErrAt creates a new error.Err error.
NewErrBefore creates a new error.Err error.
NewErrInvalidParameter creates a new error.Err error.
NewErrInvalidUsage creates a new error.Err error.
NewErrNilParameter creates a new error.Err error.
NewErrNilReceiver creates a new error.Err error with the code OperationFail.
NewErrNoSuchKey creates a new error.Err error.
NewFromError creates a new error from an error.
NewWithSeverity creates a new error.
Panic is like DisplayError but panics afterwards.
Value is a function that returns the value of the context with the given key.

# Constants

BadParameter occurs when a parameter is invalid or is not valid for some reason.
ERROR is the severity level for error messages.
FATAL is the severity level for fatal errors.
INFO is the severity level for informational messages.
InvalidUsage occurs when users call a function without proper setups or preconditions.
NoSuchKey occurs when a context key is requested but does not exist.
OperationFail occurs when an operation cannot be completed due to an internal error.
WARNING is the severity level for warning messages.

# Structs

Err represents a generalized error.

# Interfaces

ErrorCoder is an interface that all error codes must implement.
Pointer is an interface that checks whether a pointer is nil.

# Type aliases

ErrorCode is the type of the error code.
SeverityLevel represents the severity level of an error.