Documentation ¶
Overview ¶
Package grr provides easy, context-wrapped error handling in Go.
Index ¶
Constants ¶
View Source
const ( // Version is the version of this package being used Version = "v0.0.1" // GitCommit is the commit just before the latest version commit GitCommit = "81c9012" // VersionDate is the date-time of the latest version commit in UTC (in the format 'YYYY-MM-DD HH:MM', which is the Go format '2006-01-02 15:04') VersionDate = "2023-09-21 02:45" )
Variables ¶
View Source
var Debug = false
Debug is whether to put the program in debug mode and print the stack traces for errors.
Functions ¶
func Errorf ¶
Errorf returns a new error with the given format and arguments, wrapped with a stack trace via Wrap. The result guaranteed to be of type *Error. It is the grr equivalent of fmt.Errorf.
func New ¶
New returns a new error with the given text, wrapped with a stack trace via Wrap. The result guaranteed to be of type *Error. It is the grr equivalent of errors.New.
Types ¶
type Error ¶
Error is the main type of grr and represents an error with a base error and a stack trace.
func (*Error) Error ¶
Error returns the error as a string, wrapping the string of the base error with the stack trace.
Click to show internal directories.
Click to hide internal directories.