Tuesday, 6 April 2021

unhandled exception handler missing exception info

Similarly to ask made in this question, I am trying to push all unhandled errors to our telemetry pipeline in order to provide enough information for engineers to debug the problems.

The unhandled exception handler was set up in following way:

window.onerror = (event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error) => {
        const message: string = `src: ${source} line: ${lineno} col: ${colno}`;
        logError(error || new Error(event.toString()), message);
    };

This seems to be inline with documentation.

After telemetry started flowing I observed following:

  1. For majority of handler invocations error variable is null.
  2. lineno and colno are also either null or 0.

I am aware of CROSSORIGIN setting and it seems to be set up properly.

I wasn't able to find any strict rules that describe what info is provided during unhandled callback. I am also looking for feedbacks on the way we set up unhandled callback and ideas for potential improvements.



from unhandled exception handler missing exception info

No comments:

Post a Comment