Files
docker-agent/pkg/evaluator/terminal.go
T
2026-10-01 15:43:56 +02:00

18 lines
586 B
Go

package evaluator
import "errors"
// TerminalError marks a failure that must end the run. Callers with a fallback
// for ordinary assessment failures must not apply it to a terminal one, such
// as an exhausted budget or untrustworthy usage accounting.
type TerminalError struct{ Err error }
func (e *TerminalError) Error() string { return e.Err.Error() }
func (e *TerminalError) Unwrap() error { return e.Err }
// IsTerminal reports whether err, or any error it wraps, is terminal.
func IsTerminal(err error) bool {
var terminal *TerminalError
return errors.As(err, &terminal)
}