Ajax: Protect against exceptions thrown synchronously by xhr.send #1497

Closed
wants to merge 1 commit into from

2 participants

@jaubourg
jQuery Foundation member

When xhr.send throws an exception synchronously, the onerror handler may have
been called already which, unchecked, makes the exception bubble up outside of
jQuery.ajax.

We now catch the exception pre-emptively and only rethrow if we know it hasn't
already been notified through the onerror handler.

Fixes #14683

@jaubourg jaubourg Ajax: Protect against exceptions thrown synchronously by xhr.send
When xhr.send throws an exception synchronously, the onerror handler may have
been called already which, unchecked, makes the exception bubble up outside of
jQuery.ajax.

We now catch the exception pre-emptively and only rethrow if we know it hasn't
already been notified through the onerror handler.

Fixes #14683
ce8a24b
@jaubourg
jQuery Foundation member

So, unless someone has a strong opinion against this, I'll merge later today (monday here).

@dmethvin
jQuery Foundation member

@jaubourg this looks fine, do you mind if I land it before the .1 releases?

@jaubourg
jQuery Foundation member

Err... I probably did something wrong because this should be closed seeing as I already landed it Oo

@dmethvin
jQuery Foundation member

Yes indeedy! Landed at 01c360f

@dmethvin dmethvin closed this Mar 14, 2014
@dmethvin dmethvin deleted the bug_14683 branch Mar 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment