Bug Tracker


Ticket #10646 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:


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

comment:1 Changed 2 years ago by dmethvin

  • Owner set to dmethvin
  • Status changed from new to assigned

comment:2 Changed 2 years ago by dmethvin

  • Priority changed from undecided to low
  • Version changed from 1.7b2 to 1.7rc2
  • Component changed from unfiled to core
  • Milestone changed from None to 1.7.1

comment:3 Changed 2 years ago by timmywil

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

comment:4 Changed 2 years ago by Dave Methvin

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Changeset: 8d2655d20c46e7356d832e855c76b813679ccecf

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.