@jsvision/i18n / I18nError
Class: I18nError
Defined in: errors.ts:27
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: errors.ts:41
Creates a typed i18n failure.
Parameters
code
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
readonlycode:I18nCode
Defined in: errors.ts:29
Machine-stable error category.
issues
readonlyissues: readonlyCatalogIssue[]
Defined in: errors.ts:32
Copied structural issues that contributed to the failure.