Bug Tracker

Opened 12 years ago

Closed 12 years ago

#10646 closed bug (fixed)

Have jQuery.error throw instanceof Error object

Reported by: dmethvin Owned by: dmethvin
Priority: low Milestone: 1.7.1
Component: core Version: 1.7rc2
Keywords: Cc:
Blocked by: Blocking:


Right now jQuery.error() rethrows the string argument that it gets. This doesn't play well with IE<9, which prefers to get an Error object or it doesn't show much useful information. See http://www.nczonline.net/blog/2009/03/10/the-art-of-throwing-javascript-errors-part-2/

Basically, just change throw msg to throw new Error(msg).

Change History (4)

comment:1 Changed 12 years ago by dmethvin

Owner: set to dmethvin
Status: newassigned

comment:2 Changed 12 years ago by dmethvin

Component: unfiledcore
Milestone: None1.7.1
Priority: undecidedlow
Version: 1.7b21.7rc2

comment:3 Changed 12 years ago by Timmy Willison

The same in sizzle: http://jqbug.com/10584

comment:4 Changed 12 years ago by Dave Methvin

Resolution: fixed
Status: assignedclosed

Fix #10646. Throw an Error object from .error() for IE's sake.

Changeset: 8d2655d20c46e7356d832e855c76b813679ccecf

Note: See TracTickets for help on using tickets.