Documentation ¶
Overview ¶
Package errutil is a utility package for errors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ScopeDelimiter = "/"
ScopeDelimiter is the delimiter used in joined error scopes.
Functions ¶
func AsPos ¶
AsPos returns the position of the error, or 0,0 if the error doesn't have a position.
Only the first position found is used. I.e. shadowed Pos errors are ignored.
func NewPos ¶
NewPos wraps an error with a position. If added to an error that already has a position, then that inner position is shadowed by this new position, rendering it hidden/ignored.
func NewPosFromNode ¶
NewPosFromNode is a utility function that creates a new Pos error based on the position info from a YAML node.
Types ¶
type Pos ¶
Pos is a positioned error type that holds metadata about where the error occurred (line and column).
type Scoped ¶
type Scoped struct {
// contains filtered or unexported fields
}
Scoped is an error that is scoped. Each scope adds a substring to the scope, delimited by ScopeDelimiter.
type Slice ¶
type Slice []error
Slice is a slice of errors.
func ScopeSlice ¶
ScopeSlice adds paths to all the errors in the slice.