0

I'm looking for a hook to use whenever an error is fired. I'm aware that you can try/catch but I want something like jQuery's .error but bound to all errors.

Anyone know of anything like this?

2
  • what kind of error's , can you list some of them ? Commented Apr 22, 2013 at 11:33
  • var obj; obj.something += "rawr"; //obj.something is null Commented Apr 22, 2013 at 13:21

1 Answer 1

1

Perhaps this is what you are looking for window.onerror

Summary

An event handler for runtime script errors.

Note that some/many error events do not trigger window.onerror, you have to listen for them specifically.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.