diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-27 18:53:15 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-27 18:53:15 +0900 |
| commit | 598c7aa30fa2fb8f0f21666ea7986521bd064327 (patch) | |
| tree | 1edc9d628dc931617d172f48a5bd4572e3517fb7 | |
| parent | b18f40d974ffc33f3703d46bfe42d6fa2f844a01 (diff) | |
internal/report: strict-exempt severity
For reportable but inconsequential errors like modprobe by MODALIAS failures.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/report/report.go | 10 |
1 files changed, 7 insertions, 3 deletions
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) } |
