diff --git a/internal/report/report.go b/internal/report/report.go index 133176da..cbac1c34 100644 --- a/internal/report/report.go +++ b/internal/report/report.go @@ -15,8 +15,10 @@ import ( ) const ( + // Trivial denotes an error that may happen frequently under normal operation. + Trivial = iota // Inconsistent denotes an error diagnosed due to inconsistent state. - Inconsistent = iota + Inconsistent // Degraded denotes an error condition causing a degraded state. Degraded // Fatal denotes an unrecoverable error. This is generally followed by @@ -88,6 +90,8 @@ func (e Error) MarshalJSON() (data []byte, err error) { }{Message: e.Message} switch e.Severity { + case Trivial: + v.Severity = "trivial" case Inconsistent: v.Severity = "inconsistent" case Degraded: @@ -162,11 +166,11 @@ func (r *Reporter) dispatch(severity int, message string, e error) (err error) { err = _err } r.mu.Unlock() - } else if flag&DBypassEarly == 0 { + } else if flag&DBypassEarly == 0 && severity != Trivial { panic(p) } - if flag&DStrict != 0 { + if flag&DStrict != 0 && severity != Trivial { panic(p) }