mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-14 20:35:47 +01:00
Core: Throw better errors for bad rule methods
99% of type errors in this situation are misspelled rules, so be specific in the throw Closes #1395
This commit is contained in:
committed by
Jörn Zaefferer
parent
e88f2ef98a
commit
f3b1e415cf
@@ -632,6 +632,10 @@ $.extend( $.validator, {
|
|||||||
if ( this.settings.debug && window.console ) {
|
if ( this.settings.debug && window.console ) {
|
||||||
console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
|
console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e );
|
||||||
}
|
}
|
||||||
|
if ( e instanceof TypeError ) {
|
||||||
|
e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.";
|
||||||
|
}
|
||||||
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user