Skip to content

@jsvision/ui / I18nError

Class: I18nError

Defined in: i18n/dist/errors.d.ts:25

Typed configuration, validation, formatter, and loading error.

Runtime translation misses use bounded diagnostics instead of throwing this error.

Example

ts
import { I18nError, createI18n } from '@jsvision/i18n';

try {
  createI18n({ locale: 'not_a_locale' });
} catch (error) {
  if (error instanceof I18nError) console.error(error.code);
}

Extends

  • Error

Constructors

Constructor

new I18nError(code, message, options?): I18nError

Defined in: i18n/dist/errors.d.ts:37

Creates a typed i18n failure.

Parameters

code

I18nCode

Machine-stable error category.

message

string

Value-free developer explanation.

options?

I18nErrorOptions

Optional copied issues and retained cause.

Returns

I18nError

Overrides

Error.constructor

Properties

code

readonly code: I18nCode

Defined in: i18n/dist/errors.d.ts:27

Machine-stable error category.


issues

readonly issues: readonly CatalogIssue[]

Defined in: i18n/dist/errors.d.ts:29

Copied structural issues that contributed to the failure.