Skip to main content

Bug Tracker

Side navigation

#10906 closed bug (wontfix)

Opened November 28, 2011 02:21AM UTC

Closed December 03, 2011 12:43PM UTC

Last modified February 22, 2013 10:35AM UTC

ajaxStop event not fired when one of the ajax success throw exception

Reported by: jackysee@gmail.com Owned by: jackysee@gmail.com
Priority: low Milestone: None
Component: ajax Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

Example here:

http://jsfiddle.net/wVjZy/

The problem is that there is no error shown in console. The return callback seems to be try-catch-ed, making it difficult to debug.

Attachments (0)
Change History (6)

Changed November 28, 2011 11:52PM UTC by sindresorhus comment:1

owner: → jackysee@gmail.com
status: newpending

What browser and version are you using?

I tried the fiddle on Chrome 15 and Firefox 8, and correctly got the error in console:

uncaught exception: Error in success function

Changed November 30, 2011 01:37AM UTC by jackysee@gmail.com comment:2

status: pendingnew

I tried it on Firefox (Aurora) 10

Changed November 30, 2011 09:49AM UTC by sindresorhus comment:3

status: newpending

jQuery does not support dev browser versions, since they might during development.

Can you reproduce it on any stable browser?

Changed December 03, 2011 02:38AM UTC by jackysee@gmail.com comment:4

status: pendingnew

Cannot reproduce the bug in other stable browser.

Changed December 03, 2011 12:43PM UTC by sindresorhus comment:5

component: unfiledajax
priority: undecidedlow
resolution: → wontfix
status: newclosed

Closing this as a wontfix. Can be opened if this still occurs when the stable version is released.

Changed February 22, 2013 10:35AM UTC by erikjan.vos@nelen-schuurmans.nl comment:6

I was surprised this was the only page I could find on this issue. Generally that means I'm doing something wrong :-)

But running this slightly improved fiddle:

http://jsfiddle.net/wVjZy/2/

causes both stable IE9 and FF18 to not trigger the ajaxStop event.

Shouldn't the Ajax event handlers act "decoupled" and be executed in a try...catch...finally block, like this?

try {
    successCallback();
}
// IE8 needs an explicit catch block
catch (e) {
    throw e;
}
finally {
    triggerAjaxComplete();
}

Or is throwing an exception and re-throwing to some exception handler lower in the stack not how things are done in the Javascript world?