Skip to content

Documentation / @facturometro/einvoice / XmlSyntaxError

Class: XmlSyntaxError ​

Defined in: packages/core/src/errors.ts:67

The document is not well-formed XML.

Wraps the underlying parser failure (available as cause) and points at the offending position in the source text.

Example ​

ts
import { XmlSyntaxError } from '@facturometro/core';

throw new XmlSyntaxError('Missing end tag.', { column: 12, excerpt: '<cbc:ID>INV-1', line: 3 });

Extends ​

Constructors ​

Constructor ​

new XmlSyntaxError(message, position, options?): XmlSyntaxError

Defined in: packages/core/src/errors.ts:89

Creates an XML syntax error.

Parameters ​

message ​

string

Description of the syntax problem, kept verbatim.

position ​

Where the document broke, and the source text around it.

column ​

number

1-based column of the syntax error.

excerpt ​

string

Source text around the syntax error.

line ​

number

1-based line of the syntax error.

options? ​

ErrorOptions

Standard error options, in particular cause.

Returns ​

XmlSyntaxError

Overrides ​

EInvoiceError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from ​

EInvoiceError.cause


code ​

readonly code: "EINV-XML-SYNTAX"

Defined in: packages/core/src/errors.ts:68

Stable, machine-readable identifier of the failure.

Overrides ​

EInvoiceError.code


column ​

readonly column: number

Defined in: packages/core/src/errors.ts:71

1-based column of the syntax error.


excerpt ​

readonly excerpt: string

Defined in: packages/core/src/errors.ts:74

Source text around the syntax error, for error messages.


line ​

readonly line: number

Defined in: packages/core/src/errors.ts:77

1-based line of the syntax error.


message ​

message: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from ​

EInvoiceError.message


name ​

name: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from ​

EInvoiceError.name


stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

EInvoiceError.stack

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