Documentation / @einvoice-ts/validator / ruleErrorIssue
Function: ruleErrorIssue() ​
ruleErrorIssue(
rule,error,env):Issue
Defined in: packages/validator/src/engine/issue.ts:277
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 ​
The rule.
error ​
unknown
What it threw.
env ​
The run's shared fields.
Returns ​
The issue.
Example ​
ts
import { ruleErrorIssue } from '@einvoice-ts/validator';
ruleErrorIssue(rule, new TypeError('boom'), env).message;
// 'Rule BR-01 could not be evaluated: boom'