Class: ExtensibleError
@ima/core.ExtensibleError
Base class of custom error classes, extending the native Error
class.
This class has been introduced to fix the Babel-related issues with extending the native JavaScript (Error) classes.
Param
The message describing the cause of the error.
Param
Whether or not the call stack frames referring to the constructors of the custom errors should be excluded from the stack of this error (just like the native platform call stack frames are dropped by the JS engine). This flag is enabled by default.
Hierarchy
Error
↳
ExtensibleError
↳↳
Error
Constructors
constructor
• new ExtensibleError(message
, dropInternalStackFrames?
)
Parameters
Name | Type | Default value |
---|---|---|
message | string | undefined |
dropInternalStackFrames | boolean | true |
Overrides
Error.constructor
Defined in
packages/core/src/error/ExtensibleError.ts:43
Properties
_dropInternalStackFrames
• Protected
_dropInternalStackFrames: boolean
Defined in
packages/core/src/error/ExtensibleError.ts:15
cause
• Optional
cause: unknown
Inherited from
Error.cause
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:26
message
• message: string
Inherited from
Error.message
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1054
name
• name: string
Inherited from
Error.name
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1053
prepareStackTrace
▪ Static
Optional
prepareStackTrace: (err
: Error
, stackTraces
: CallSite
[]) => any
Type declaration
▸ (err
, stackTraces
): any
Optional override for formatting stack traces
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Parameters
Name | Type |
---|---|
err | Error |
stackTraces | CallSite [] |
Returns
any
Inherited from
Error.prepareStackTrace
Defined in
node_modules/@types/node/globals.d.ts:11
stackTraceLimit
▪ Static
stackTraceLimit: number
Inherited from
Error.stackTraceLimit
Defined in
node_modules/@types/node/globals.d.ts:13
Accessors
stack
• get
stack(): undefined
| string
Returns
undefined
| string
Overrides
Error.stack
Defined in
packages/core/src/error/ExtensibleError.ts:17
Methods
captureStackTrace
▸ Static
captureStackTrace(targetObject
, constructorOpt?
): void
Create .stack property on a target object
Parameters
Name | Type |
---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTrace
Defined in
node_modules/@types/node/globals.d.ts:4