Package errors implements errors that can be easily sent across the wire and reconstructed at the other end.
const ( // UnknownModule is the module name used when the module is unknown. UnknownModule = "unknown" // CodeNoError is the reserved "no error" code. CodeNoError = 0 )
Re-exports so this package can be used as a replacement for errors.
Code returns the module and code for the given error.
In case the error is not of the correct type, default values for an unknown error are returned.
In case the error is nil, an empty module name and CodeNoError are returned.
Context returns the additional context associated with the error.
FromCode reconstructs a previously registered error from module and code.
In case an error cannot be resolved, this method returns a new error with its message equal to the passed message string.
New creates a new error.
Module and code pair must be unique. If they are not, this method will panic.
The error code must not be equal to the reserved "no error" code.
This section is empty.