Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Error Handling module establishes methods for logging and handling errors that occur in experience designer code.

Table of Contents

Dependencies

The Error Handling module is dependent on the following modules:

The Error Type Schema

The Error Type schema is a global dynamic schema used to configure and track occurrence counts for a particular error type. It has the following fields:

...

Info

sendSupportEmails is automatically set to true when a new Error Type is created on production environments. threshold is automatically set to 1 in this case if no defaultThreshold setting has been set.

The Error Schema

The Error schema is a global dynamic schema used to record details about a particular occurrence of an error.

  • sessionID (string): The ID of the session during which the error occurred.

  • timestamp (date): The date and time when the error occurred.

  • type (string): The type of the error.

  • message (string): The error message, if any.

  • source (string): The name, type, and ID of the node in experience designer that the error originated from.

Methods

logError

Logs an error in the console and creates an Error record. Will also create a new Error Type record if the error type has not been configured before, and will send a notification email when appropriate.

...

  • type (string): The type of the error.

  • msg (string): The Node-RED message object.

  • message (string): An explicit error message to record (will supersede any message in msg.error).

Returns: Nothing.

unhandledErrorResponse

Attempts to handle an unhandled error (based on context) to display the default error message to the user:

...

  • msg (string): The Node-RED message object.

Returns: Nothing.

Settings

Settings specific to the Error Handling module are specified under settings.errorHandling:

...

Code Block
  "errorHandling": {
      "defaultMessage": "I'm sorry, an unexpected error has occurred. Please try again later.",
      "defaultEmails": [
          "andrew.merola@orbita.ai",
          "mark.cline@orbita.ai",
          "jason.masterson@orbita.ai"
      ],
      "defaultThreshold": 5
  }

Error Count Reset

The module includes a scheduled process that runs at 4:00 AM GMT every day to reset the current count in each Error Type record to 0.