Error is an interface for errors that carry additional context information.
| 6 | |
| 7 | // Error is an interface for errors that carry additional context information. |
| 8 | type Error interface { |
| 9 | // Error returns the error message. |
| 10 | Error() string |
| 11 | |
| 12 | // StatusCode returns the HTTP status code associated with the error. |
| 13 | StatusCode() int |
| 14 | // PublicMessage returns the public message associated with the error. |
| 15 | PublicMessage() string |
| 16 | // ShouldReport indicates whether the error should be reported. |
| 17 | ShouldReport() bool |
| 18 | // DocsURL returns the documentation URL associated with the error. |
| 19 | DocsURL() string |
| 20 | |
| 21 | // StackTrace returns the stack trace associated with the error. |
| 22 | // This method is traditionally used to retrieve the stack trace |
| 23 | // by packages like error reporters. |
| 24 | StackTrace() []uintptr |
| 25 | // Callers returns the stack trace associated with the error. |
| 26 | // This method is traditionally used to retrieve the stack trace |
| 27 | // by packages like error reporters. |
| 28 | Callers() []uintptr |
| 29 | // FormatStack returns the stack trace as a formatted string. |
| 30 | FormatStack() string |
| 31 | |
| 32 | // CloneErrorContext returns a copy of the error context |
| 33 | // with applied options. |
| 34 | CloneErrorContext(opts ...Option) *ErrorContext |
| 35 | } |
| 36 | |
| 37 | // ErrorType returns the type name of the given error. |
| 38 | // If the error is [WrappedError], it returns the type of the inner error. |
no outgoing calls
no test coverage detected