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.
Signature
Section titled SignaturehandleError: (e: Error | ErrorEvent | PromiseRejectionEvent, metadata?: Record<string, any>) => void
Parameters
Section titled Parameterse: 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.
Return value
Section titled Return valueThis method doesn’t return any values, the saved information can be seen inside the OpenReplay platform.