Skip to content

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 ​

Rule

The rule.

error ​

unknown

What it threw.

env ​

IssueEnvironment

The run's shared fields.

Returns ​

Issue

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'

MIT licensed. Specification material belongs to OpenPeppol, CEN and OASIS (see NOTICE). Peppol is a trademark of OpenPeppol AISBL; this project is not affiliated with it.