Skip to main content

Bug Tracker

Side navigation

#11292 closed bug (notabug)

Opened February 06, 2012 08:19PM UTC

Closed October 15, 2012 10:07PM UTC

Error During Done Function on a Promise Is Skipped on Subsequent Runs

Reported by: jrduncans Owned by:
Priority: low Milestone: 1.next
Component: deferred Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

Having an error in a .done() callback function seems to permanently break the state of a Deferred, in a way that success does not. The documentation of Deferred does not cover error handling within callbacks, so it's not clear if this is by design or not.

Demo: http://jsfiddle.net/2JFnM/

Attachments (0)
Change History (6)

Changed February 08, 2012 09:45AM UTC by sindresorhus comment:1

component: unfileddeferred
keywords: → needsdocs
priority: undecidedlow
status: newopen

I think the consensus is that you should handle your own exceptions. jQuery should not hide it away.

See the duplicates for more info and discussion.

Duplicates: #11207, #11193, #9033

Leaving it open so that it can be documented.

Changed March 10, 2012 04:12PM UTC by dmethvin comment:2

milestone: None1.8

Dean Edwards documented a way of using synthetic events as callbacks to prevent this problem, but I don't know if it can be applied. The use of a propertychange handler on documentElement seems like it might pose some performance problems.

http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/

Let's explore for 1.8 and decide whether it can be fixed or if we should just document current behavior.

Changed April 01, 2012 10:28PM UTC by jaubourg comment:3

Eveything is said here: http://bugs.jquery.com/ticket/11193#comment:3

In an ideal world, we'd be able to use try/finally but, because of IE, we can't.

Changed June 18, 2012 05:27PM UTC by dmethvin comment:4

milestone: 1.81.next

This can be fixed eventually, but not until oldIE bites the dust.

Changed October 15, 2012 10:07PM UTC by mikesherov comment:5

keywords: needsdocs

Changed October 15, 2012 10:07PM UTC by mikesherov comment:6

resolution: → notabug
status: openclosed