Skip to main content

@terascope/utils / errors / TSError

Class: TSError

Defined in: packages/utils/src/errors.ts:15

A custom Error class with additional properties, like statusCode and fatalError

Extends

  • Error

Constructors

new TSError()

new TSError(input, config): TSError

Defined in: packages/utils/src/errors.ts:53

Parameters

ParameterType
inputunknown
configTSErrorConfig

Returns

TSError

Overrides

Error.constructor

Properties

PropertyTypeDescriptionDefined in
codestringAn descriptive error code that specifies the error type, this follows more node conventionpackages/utils/src/errors.ts:20
contextTSErrorContextAdditional context metadatapackages/utils/src/errors.ts:42
fatalErrorbooleanUsed to indicate the an error is fatalpackages/utils/src/errors.ts:30
retryable?booleanUsed sometimes to indicate whether an error is retryable If this is not set then it is better not to assume either waypackages/utils/src/errors.ts:37
statusCodenumberA HTTP status code for easy usepackages/utils/src/errors.ts:25

Methods

getCause()

getCause(): any

Defined in: packages/utils/src/errors.ts:94

Returns

any


[hasInstance]()

static [hasInstance](_instance): boolean

Defined in: packages/utils/src/errors.ts:44

Parameters

ParameterType
_instanceunknown

Returns

boolean