There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This was removed on purpose. Adding a catch block makes it impossible to debug in any browser. If IE8- complains, so be it.
See 5d9db48 and http://bugs.jquery.com/ticket/8353
The problem only occurs when an exception is thrown and only in IE. Better have an issue in IE rather than in every other browser. Would be a good idea to revert this.
Sorry, something went wrong.
Sorry, I didn't see it was added in the past. So even with throwing the error, other browsers won't see it?
Seems like it works ok. http://jsfiddle.net/timmywil/zWrJJ/1/
Of course, "it works". Even the try/finally construct will work flawlessly in anything but IE8- :P
Like I said, the issue is debugging: you loose context (original file and line of the exception) and everything seems to originate from the catch/throw block. It makes it a nightmare to debug and even confuses users who think the exception actually really occured within the deferred code itself.
Ah yea, didn't think about line of exception. Tickets for this keep coming so I would love to have a solution by 1.6.2. Maybe we can do some brainstorming.
I think the solution has to be that if you expect your callback to throw exceptions then you try/catch it inside the callback. If the problem is due to programming errors then it's debugger time, or you can just leave the try/catch in for production. I know it's an unfortunate problem since IE6/7 are browsers most likely to fail. But like @jaubourg says if we add the catch we totally screw up debugging in every other browser and hide problems.
/me shakes fist at IE7