Definitions
Error renderers
defineErrorRenderer writes the why, the fix and the alert headline for errors your app does not explain itself.
The best place to explain an error is where it is thrown: set why and fix on the wide event. For errors you cannot change, from a library or a provider, write it in Vigie:
definitions/renderers/invoxa.ts
import { defineErrorRenderer } from 'vigie/sdk'
export const invoxa = defineErrorRenderer({
id: 'invoxa',
match: (error) => error.code.startsWith('INVOXA_'),
why: (error) => `Invoxa refused the call: ${error.message}.`,
fix: () => 'Fix the customer in Invoxa, then requeue the task from its run page.',
headline: () => 'Invoices are not reaching Invoxa',
recovered: () => 'Invoices reach Invoxa again',
link: () => 'https://docs.acme.dev/invoxa',
})
| Field | Shown |
|---|---|
match | Required. Receives name, message, code and attr(key) for any field of the event. |
why, fix | On the issue, the event panel and in agent answers. |
headline | The sentence an alert leads with when this error is behind it. |
recovered | The sentence sent when it stops. |
link | A runbook or doc page. |
The first renderer that matches wins. What the app sets on the event always comes first.