mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Check type of onException argument to bindEnvironment
Meteor.bindEnvironment() can have an invalid error handler accidentally passed as the second argument, especially in CoffeeScript where the issue is not easy to find. This can cause a cryptic error message about an exception being thrown when onException() itself is being called.
This commit is contained in:
committed by
Avital Oliver
parent
e3234ea99f
commit
0e22996547
@@ -94,6 +94,8 @@ Meteor.bindEnvironment = function (func, onException, _this) {
|
||||
error && error.stack || error
|
||||
);
|
||||
};
|
||||
} else if (typeof(onException) !== 'function') {
|
||||
throw new Error('onException argument must be a function, string or undefined for Meteor.bindEnvironment().');
|
||||
}
|
||||
|
||||
return function (/* arguments */) {
|
||||
|
||||
Reference in New Issue
Block a user