package
module
Version:
v0.4.1
Opens a new window with list of versions in this module.
Published: Nov 9, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 3,481
Opens a new window with list of known importers.
README
¶
microerror
Go library to facilitate error handling.
Documentation
¶
Cause is here only for backward compatibility purposes and should not be used.
NOTE: Use errors.Is/errors.As instead.
JSON prints the error with enriched information in JSON format. Enriched
information includes:
- All fields from Error type.
- Error stack.
The rendered JSON can be unmarshalled with JSONError type.
type Error struct {
Desc string `json:"desc,omitempty"`
Docs string `json:"docs,omitempty"`
Kind string `json:"kind"`
}
GoString is here for backward compatibility.
NOTE: Use JSON(err) instead of Printf("%#v", err).
type JSONError struct {
*Error `json:",inline"`
Annotation string `json:"annotation,omitempty"`
Stack []StackEntry `json:"stack,omitempty"`
}
type StackEntry struct {
File string `json:"file"`
Line int `json:"line"`
PC uintptr `json:"-"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.