OptionError
Defined in: src/option_error.ts:16 (opens in a new tab)
Error raised for an option that cannot be resolved: an unknown key or
preset, a value outside the accepted ones, or two values that cannot be
combined. A RangeError, with the option named by path and what was
received, what is accepted, and the replacement of a key or value that a
release candidate of 1.0.0 knew, when there is one. The message is for
humans.
Extends
Section titled “Extends”RangeError
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OptionError(
message,details):OptionError
Defined in: src/option_error.ts:38 (opens in a new tab)
Creates the error with its message and the details of the option.
Parameters
Section titled “Parameters”message
Section titled “message”string
details
Section titled “details”accepted
Section titled “accepted”readonly string[]
string
received
Section titled “received”unknown
replacement?
Section titled “replacement?”string
Returns
Section titled “Returns”OptionError
Overrides
Section titled “Overrides”RangeError.constructor
Properties
Section titled “Properties”accepted
Section titled “accepted”
readonlyaccepted: readonlystring[]
Defined in: src/option_error.ts:26 (opens in a new tab)
The accepted values of the option, or the accepted keys of its group. For two values that cannot be combined, the values accepted next to the other one.
cause?
Section titled “cause?”
optionalcause?:unknown
Defined in: web/docs/node_modules/typescript/lib/lib.es2022.error.d.ts:24
Inherited from
Section titled “Inherited from”RangeError.cause
message
Section titled “message”message:
string
Defined in: web/docs/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
Section titled “Inherited from”RangeError.message
name:
string
Defined in: web/docs/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
Section titled “Inherited from”RangeError.name
readonlypath:string
Defined in: src/option_error.ts:18 (opens in a new tab)
Dotted path of the option, such as "transliteration.eta" or "preset"; for a key of a converter’s configuration, such as "exclude" or "aliases[0].spellings".
received
Section titled “received”
readonlyreceived:unknown
Defined in: src/option_error.ts:20 (opens in a new tab)
The value received, or undefined for an unknown key.
replacement?
Section titled “replacement?”
readonlyoptionalreplacement?:string
Defined in: src/option_error.ts:35 (opens in a new tab)
The current path of a removed key, or the current spelling of a renamed
value, for the names of the release candidates of 1.0.0: a migration
aid, which a minor release after 1.0.0 may stop giving
(docs/stability.md). A property of the error only when there is one:
declared without a field, which would set it to undefined on every
error.
stack?
Section titled “stack?”
optionalstack?:string
Defined in: web/docs/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”RangeError.stack