Skip to main content

@terascope/core-utils / errors / TSError

Class: TSError

Defined in: packages/core-utils/src/errors.ts:13

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

Extends

  • Error

Constructors

Constructor

new TSError(input, config?): TSError

Defined in: packages/core-utils/src/errors.ts:51

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/core-utils/src/errors.ts:18
contextTSErrorContextAdditional context metadatapackages/core-utils/src/errors.ts:40
fatalErrorbooleanUsed to indicate the an error is fatalpackages/core-utils/src/errors.ts:28
retryable?booleanUsed sometimes to indicate whether an error is retryable If this is not set then it is better not to assume either waypackages/core-utils/src/errors.ts:35
statusCodenumberA HTTP status code for easy usepackages/core-utils/src/errors.ts:23

Methods

getCause()

getCause(): any

Defined in: packages/core-utils/src/errors.ts:92

Returns

any


[hasInstance]()

static [hasInstance](_instance): boolean

Defined in: packages/core-utils/src/errors.ts:42

Parameters

ParameterType
_instanceunknown

Returns

boolean