Custom Events and Errors

📘

You must have SDK version v19.7.0 to use this feature.

You may wish to tell the capture script about application errors or messages so that you can see them in the replay and meta-data. The SDK can manage normal JavaScript errors, but server errors or custom error states like invalid username or passwords require additional setup.

To signal a custom error or event, use the Public API:

// Log an error
FSR.Record.error(message, metadata);

// Log another type of event
FSR.Record.event(eventname, metadata);

Two methods, error and message, which have the same interface and take two arguments:

  • message or eventname : (String) A short description or code representing the error. Max length: 256 characters.
  • metadata: (Object) A JSON object representing the message or error. The stringified copy of this object must be no larger than 10KB.