Documentation ¶
Index ¶
- Variables
- func Print(w io.Writer, err error)
- type List
- func (l *List) Abort()
- func (l *List) Add(pos token.Pos, msg string)deprecated
- func (l *List) AddRaw(err *scanner.Error)deprecated
- func (l *List) Addf(pos token.Pos, format string, args ...interface{})deprecated
- func (l *List) Err() error
- func (l *List) Error() string
- func (l *List) ErrorList() []*errinsrc.ErrInSrc
- func (l *List) HandleBailout(err *error)
- func (l *List) Len() int
- func (l *List) MakeRelative(root, relwd string)
- func (l *List) Merge(other *List)deprecated
- func (l *List) Report(err error)
- func (l *List) SendToStream(stream interface{ ... }) error
Constants ¶
This section is empty.
Variables ¶
var MaxErrorsToPrint = 1
MaxErrorsToPrint is the maximum number of errors to print if Verbose is false
var Verbose = false
Verbose controls whether the error list prints all errors or just the what MaxErrorsToPrint is set to
Functions ¶
Types ¶
type List ¶
type List struct { List errinsrc.List `json:"list,omitempty"` // contains filtered or unexported fields }
func Convert ¶ added in v1.8.0
Convert attempts to convert known error types into an error list if it can't it returns nil
func (*List) Err ¶
Err returns an error equivalent to this error list. If the list is empty, Err returns nil.
func (*List) HandleBailout ¶
HandleBailout handles bailouts raised by (*List).Add and family when too many errors have been found.
func (*List) MakeRelative ¶
MakeRelative rewrites the errors by making filenames within the app root relative to the relwd (which must be a relative path within the root).
func (*List) Report ¶ added in v1.8.0
Report is a function that allows you to report an error into this list, without having to check for nil.
This function only supports error of types:
- *List
- *errinsrc.ErrInSrc
- *scanner.Error
If too many errors have been reported it panics with a Bailout value to abort processing. Use HandleBailout to conveniently handle this.
func (*List) SendToStream ¶ added in v1.8.0
func (l *List) SendToStream(stream interface { Send(*daemonpb.CommandMessage) error }) error
SendToStream sends a GRPC command with this full errlist
If l is nil or empty, it sends a nil command allowing the client to know that there are no longer an error present