Skip to content

Documentation / @facturometro/einvoice / InvalidDecimalError

Class: InvalidDecimalError ​

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

A value could not be read as a decimal number.

Thrown by Decimal.from(); parsing document content uses Decimal.parse(), which reports a lexically invalid value as an issue instead of throwing.

Example ​

ts
import { Decimal, InvalidDecimalError } from '@facturometro/core';

try {
  Decimal.from('1e3');
} catch (error) {
  if (error instanceof InvalidDecimalError) console.error(error.input); // '1e3'
}

Extends ​

Constructors ​

Constructor ​

new InvalidDecimalError(input, options?): InvalidDecimalError

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

Creates an invalid decimal error.

Parameters ​

input ​

string

The value that is not a lexical XSD decimal.

options? ​

ErrorOptions

Standard error options, in particular cause.

Returns ​

InvalidDecimalError

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-INVALID-DECIMAL"

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

Stable, machine-readable identifier of the failure.

Overrides ​

EInvoiceError.code


input ​

readonly input: string

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

The rejected value, as it was supplied.


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.