-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Closed
Description
Description
If an exception is thrown in an event handler (such as $.ready), it is silently swalloed.
There are many cases in which exceptions are used to indicate errors for situations that are not code errors, for instance:
var foo = function(arg){
var result = parseFloat(arg);
if(isNaN(result)){
throw new Error('not a number');
}
};Exceptions like that may be cought by the user, such as when the number is user-input. But they may also indicate errors in the usage of the code (such as foo('123') ), in which case catching them is counter productive since they can't be debugged anymore.
Link to test case
Havunen and cjke