0

When developing your own jQuery plugins, is there a standard or a preferred way to throw errors? Should I just use jQuery.error()? Should I first set it, e.g. jQuery.error = console.error or leave it set to the default?

EDIT: To be clear, errors meant for the developer, not the user. I assume the developer should be handling all errors and my plugin should just return certain values if things fail.

CaptSaltyJack
  • 15,283
  • 17
  • 70
  • 99
  • Do not assume `console` exists! Older versions of IE will ruin you. `if (typeof console !== 'undefined') { ... }` . Also see [this answer](http://stackoverflow.com/questions/6484528/what-are-the-best-practices-for-javascript-error-handling) – Tomanow Dec 09 '14 at 02:04
  • Good thing I don't support older versions of IE! ;) But point noted. – CaptSaltyJack Dec 09 '14 at 02:06

0 Answers0