-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.go
More file actions
33 lines (33 loc) · 1.42 KB
/
Copy pathdocs.go
File metadata and controls
33 lines (33 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Package errors provides enhanced error handling capabilities with stack trace support.
//
// This package extends Go's standard error handling by providing automatic stack trace
// collection and enhanced error formatting. It offers drop-in replacements for standard
// error functions while adding valuable debugging information.
//
// Core Functions:
// - [New]: Creates a new error with stack trace information
// - [Errorf]: Formats an error with stack trace support and %w verb handling
// - [Join]: Combines multiple errors into a single error
// - [Is], [As], [Unwrap]: Standard error inspection functions
//
// Stack Traces:
//
// Stack traces are automatically added to errors created by this package unless
// the error already has a stack trace or
// the error is created in a sentinel context (like package initialization).
// Stack traces can be formatted using the %+v verb with [fmt] package.
//
// Error Formatting:
//
// Errors support enhanced formatting through the [fmt] package:
// - %s, %v: Error message
// - %+v: Error message with full stack traces
//
// Formatting can be customized using [GlobalFormatSettings] to control
// how stack traces are displayed (e.g., stripping prefixes, ignoring function names).
//
// Compatibility:
//
// This package provides deprecated compatibility functions for migration from
// [github.com/pkg/errors], but using the core API is recommended for new code.
package errors