When attempting to run the following code:
alert("Function failed with error dump <"+err.message+">");
the error message displayed is truncated:
Function failed with error dump <document.getElementsByClassName(...) is undefined>
Is there a way for the error message to be displayed in full, i.e. display the following message in Firefox? Chrome does not display the output, and therefore is not an issue for my current usage.
Function failed with error dump <document.getElementsByClassName("aklsdjfaskldf") is undefined>
Every browser handles the error call stack differently, if you are on chrome you wont even see that string. It would simply say cannot invoke that outerHTML function on undefined. So better you check the value before invoking a function on that and then show the appropriate alert. Or you print the error.stack if you want to get a hint about the location of the code throwing this error.