Documentation
¶
Overview ¶
Package sterror provides the error handling used in stboot. The core part is the constructor function E().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { // Op is operation being executed while the error occurde. Op Op // Scope is the subsytem of stboot causing the error. Scope Scope // Err is the underlying wrapped error. Err error // Info provides further context to the error or holds the string // value of the triggering error if it is not wrapped. Info string }
Error provides structured and detailed context. However, some fields may be left unset.
An Error value should be created using the E() function.
func E ¶
func E(args ...interface{}) Error
E returns an Error constructed from its arguments. There should be at least one argument, or E returns an unspecifed error. The type of each argument determines its meaning. If more than one argument of a given type is presented, only the last one is recorded.
The types are: sterror.OP - The performed operation. sterror.Scope - The subsystem where the error occurred. error - The underlying error if it should be wrapped. string - Treated as error message of an error that should not be wrapped or as additional information to the provided error.
Further types will be ignored.