Skip to main content

Error handlers

Customize the handling of the errors originating from the app.

npm install @dynatrace-sdk/error-handlers

Interfaces

CommonSerializedError

Common serialized JS Error

Properties

NameType
causeany
detailsany
errorRefstring
message*requiredstring
name*requiredstring
stackstring
type*requiredCOMMON

HttpSerializedError

Serialized http exception with response status

Properties

NameType
bodyDEPRECATEDunknown
causeany
detailsany
errorRefstring
message*requiredstring
name*requiredstring
stackstring
status*requirednumber
type*requiredHTTP

Functions

addGlobalErrorSerializer

addGlobalErrorSerializer(serializer): void

Registers a global error serializer for handling uncatched errors.

Parameters

NameTypeDescription
serializer*requiredGlobalErrorSerializerAsynchronous function which serializes error if it match the condition

isGlobalErrorSerializerSupported

isGlobalErrorSerializerSupported(): boolean

Checks if global error serializer is supported.

Returns

Description
information if global error serializer is supported on current environment.
Still have questions?
Find answers in the Dynatrace Community