Discover Packages
github.com/giantswarm/microerror
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: 338 modules, 3,775 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
microerror
Go library to facilitate error handling.
Expand ▾
Collapse ▴
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.