JavaScript global ErrorHandler: Get source map translated line from an error

Viewed 8

I have a custom global error handler:

window.sparkErrorHandler = function(message, url, line, column, error) {
   logError(message, url, line, column, error);
}

Probem is, when the error is from a minified source. Then the line does not match with my source file.

The source map file is available, of course.

How to translate the error parameters (especially the line, perhaps also the stack trace) so that logError() is called with the correct parameters?

0 Answers
Related