0

Using ErrorHandler class, I am able to capture the errors and send them to the server. I didn't get anything on the capturing of the warnings logged by JS runtime.

If we do the explicit logging, then it can be captured. But I want to capture the warnings, info and errors which are automatically displayed by the browser.

Also, here I am talking specifically about chrome browser.

Could anyone help me in this?

  1. I had tried Errorhandler class. And from ErrorHandler, I am extending the customised class which uses handle Error method.

But this is just showing the errors and not the warnings or info.

  1. Also, I had tried to override the console.warn and console.info methods which is also of no use since I am not explicitly throwing any warnings.

  2. Then I had used the code for Patching the zone.js. Still not able to capture the warning.

Once I will be able to capture the warning, then I will push the caught error, warning and info in an array.

Code2308
  • 1
  • 1
  • check this [SO](https://stackoverflow.com/questions/5328154/catch-all-javascript-errors-and-send-them-to-server) about window.error – Eliseo Jun 21 '23 at 15:36
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 03 '23 at 20:26

0 Answers0