Skip to main content

@terascope/job-components / index / TSError

Class: TSError

Defined in: packages/utils/dist/src/errors.d.ts:7

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/dist/src/errors.d.ts:32

Parameters

ParameterType
inputunknown
config?TSErrorConfig

Returns

TSError

Overrides

Error.constructor

Properties

PropertyTypeDescriptionDefined in
codestringAn descriptive error code that specifies the error type, this follows more node conventionpackages/utils/dist/src/errors.d.ts:12
contextTSErrorContextAdditional context metadatapackages/utils/dist/src/errors.d.ts:30
fatalErrorbooleanUsed to indicate the an error is fatalpackages/utils/dist/src/errors.d.ts:20
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/dist/src/errors.d.ts:26
statusCodenumberA HTTP status code for easy usepackages/utils/dist/src/errors.d.ts:16

Methods

getCause()

getCause(): any

Defined in: packages/utils/dist/src/errors.d.ts:33

Returns

any


[hasInstance]()

static [hasInstance](_instance): boolean

Defined in: packages/utils/dist/src/errors.d.ts:31

Parameters

ParameterType
_instanceunknown

Returns

boolean