Skip to main content

@terascope/core-utils / errors / TSError

Class: TSError

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

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:52

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:19
contextTSErrorContextAdditional context metadatapackages/core-utils/src/errors.ts:41
fatalErrorbooleanUsed to indicate the an error is fatalpackages/core-utils/src/errors.ts:29
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:36
statusCodenumberA HTTP status code for easy usepackages/core-utils/src/errors.ts:24

Methods

getCause()

getCause(): any

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

Returns

any


[hasInstance]()

static [hasInstance](_instance): boolean

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

Parameters

ParameterType
_instanceunknown

Returns

boolean