RUM JavaScript API - 1.345.1
    Preparing search index...

    Function sendExceptionEvent

    • Safe wrapper for dynatrace.sendExceptionEvent which reverts to a noop if RUM JavaScript is not available.

      Sends an exception event to Dynatrace RUM. The event is marked with characteristics.is_api_reported and error.source = api to distinguish API-reported errors from automatically captured ones. This function is only available if the Errors module is enabled.

      Parameters

      • error: Error

        Must be a valid instance of the Error class. If an invalid value is provided, the error will not be processed or sent.

      • Optionalfields: ApiCreatedEventPropertiesEvent

        Optional: Must be a valid JSON object and cannot contain functions, undefined, Infinity and NaN as values, otherwise they will be replaced with null. The fields need to be serializable using JSON.stringify. The resulting event will contain the provided fields, and is modified with additional properties, thus also empty objects are valid. Only properties prefixed with event_properties. are allowed. The duration property is not supported for exception events and will be dropped if provided. String properties are limited to 5000 characters, exceeding characters are cut off. All event property keys must contain only alphabetic characters, numbers, underscores or dots. Each dot must be followed by an alphabetic character. Each underscore must be followed by an alphabetic character or number.

      Returns void

      import { sendExceptionEvent } from '@dynatrace/rum-javascript-sdk/api';

      sendExceptionEvent(new Error("Your Error Message"));

      // With optional event properties
      sendExceptionEvent(new Error("Your Error Message"), {
      "event_properties.component": "myExampleComponent"
      });