Hyperlinkv0.8.0-beta.28

ErrorReporter

ErrorReporter.Reportableinterfaceeffect/ErrorReporter.ts:303
Reportable

Interface that object errors can implement to control reporting behavior.

When to use

Use as the annotation contract for object errors that customize how error reporting handles them.

Details

All three annotation properties are optional: [ErrorReporter.ignore] prevents reporting when set to true, [ErrorReporter.severity] overrides the default "Info" severity, and [ErrorReporter.attributes] adds extra key/value pairs forwarded to reporters. The global Error interface is augmented with Reportable, so these properties are available on Error instances at the type level.

export interface Reportable {
  readonly [ignore]?: boolean
  readonly [severity]?: Severity
  readonly [attributes]?: ReadonlyRecord<string, unknown>
}