Javascript Global Error Handler

Today i’have created a simple class to log in the backend the javascript error, so i can have a real time monitoring of how error appear to the users.

We can use a window.onerror and the addEventListener rewrite.

This is my class with a _wrap function, and a SendError that trasmit the data on the backend

In the message we put the stacktrace.
To use it at the init of your application:
let handlerError = new HandlerError();