JavaScript SDK ⁠-⁠ handleError method

If the default information tracked by our tracker when a JS error occurs is not enough, you can use this method.

The handleError method manually reports caught exceptions, rejected promises or error events.

See error reporting for more details.

handleError: (e: Error | ErrorEvent | PromiseRejectionEvent, metadata?: Record<string, any>) => void
  • e: Error | ErrorEvent | PromiseRejectionEvent: The actual error object being caught.
  • metadata: Record<string, any>: [Optional] A dictionary-like structure with all the extra information you want to save associated to this error.

This method doesn’t return any values, the saved information can be seen inside the OpenReplay platform.