@terascope/utils / errors / TSError
Class: TSError
A custom Error class with additional properties, like statusCode and fatalError
Extends
Error
Constructors
new TSError()
new TSError(
input
,config
):TSError
Parameters
Parameter | Type |
---|---|
input | unknown |
config | TSErrorConfig |
Returns
Overrides
Error.constructor
Source
packages/utils/src/errors.ts:53
Properties
code
code:
string
An descriptive error code that specifies the error type, this follows more node convention
Source
packages/utils/src/errors.ts:20
context
context:
TSErrorContext
Additional context metadata
Source
packages/utils/src/errors.ts:42
fatalError
fatalError:
boolean
Used to indicate the an error is fatal
Source
packages/utils/src/errors.ts:30
retryable?
optional
retryable:boolean
Used sometimes to indicate whether an error is retryable
If this is not set then it is better not to assume either way
Source
packages/utils/src/errors.ts:37
statusCode
statusCode:
number
A HTTP status code for easy use
Source
packages/utils/src/errors.ts:25
Methods
getCause()
getCause():
any
Returns
any
Source
packages/utils/src/errors.ts:94
[hasInstance]
()
static
[hasInstance](_instance
):boolean
Parameters
Parameter | Type |
---|---|
_instance | unknown |
Returns
boolean