I would like to get the code to be printed of a function when there is an error. For example I have overwritten the window.onerror function and when there is an error I want to print the complete function. Of course I get the line number but that does not work for minified js. I could implement the use of source maps but isn't there a more easy way to get the complete function in which the error happened? For example:
function example(){
//runs code which works but then an error happens
}
Now I want to print not only the one line where the error happened I want to print the whole function.