@phun-ky/arclace / ArclaceError
Class: ArclaceError
Defined in: src/errors.ts:19
Thrown when Arclace can't do what was asked, for example when a selector matches nothing, an id is taken, or the instance has been destroyed.
Arguments of the wrong type throw a TypeError, and values out of range a RangeError, instead. When another error is behind the failure, such as an invalid selector, it is the cause.
Example
try {
arclace.connect('#a', '#b', { id: 'a-to-b' });
arclace.connect('#b', '#c', { id: 'a-to-b' }); // the id is taken
} catch (error) {
if (error instanceof ArclaceError) console.warn(error.message);
}Extends
Error
Constructors
Constructor
new ArclaceError(
message,options?):ArclaceError
Defined in: src/errors.ts:22
Parameters
message
string
options?
ErrorOptions
Returns
ArclaceError
Overrides
Error.constructor
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:24
Inherited from
Error.cause
message
message:
string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
Error.message
name
name:
string='ArclaceError'
Defined in: src/errors.ts:20
Overrides
Error.name
stack?
optionalstack?:string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.stack