0

So I have some code that I cannot edit that sometimes errors out due to various reason I cannot control. This can be a failed ajax call (non-jQuery) or simply a function that fails. Is there any way I can do a generic JS error catch (I do use jQuery) if I do not have access to the code that generates them?

naspinski
  • 34,020
  • 36
  • 111
  • 167

1 Answers1

3

Try with onerror

window.onerror = function() {
    alert("error");
};
MazzCris
  • 1,812
  • 1
  • 14
  • 20