Skip to content

Documentation / @facturometro/einvoice / ruleErrorIssue

Function: ruleErrorIssue() ​

ruleErrorIssue(rule, error, env): Issue

Defined in: packages/validator/src/engine/issue.ts:253

The fatal issue for a rule that threw while being evaluated. Validation always completes; a broken rule is reported as one issue naming it, and the document is not judged valid.

Parameters ​

rule ​

Rule

The rule.

error ​

unknown

What it threw.

env ​

IssueEnvironment

The run's shared fields.

Returns ​

Issue

The issue.

Example ​

ts
import { ruleErrorIssue } from '@facturometro/validator';

ruleErrorIssue(rule, new TypeError('boom'), env).message;
// 'Rule BR-01 could not be evaluated: boom'

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.