There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... you probably shouldn't here. We're supposed to give the exception object to the error callbacks. What are we trying to handle here exactly ?
Sorry, something went wrong.
Oh good, daddy is here! :)
IE won't give the user any useful error information if a plain string is thrown, so we changed jQuery.error to throw new Error(msg) instead. Since ajax uses it to throw in the transports I needed to find the places it was expecting strings. Thoughts?
throw new Error(msg)
Well, it's not actually expecting a string here, because it's catching around the use of converters (where native exceptions can be thrown depending on how such or such converter is implemented). The third parameter of the error callbacks (which is the sole use of the error variable here) is supposed to be the original exception whenever available. In fact same goes for transports actually.