diff --git a/src/ui/public/promises/promises.js b/src/ui/public/promises/promises.js index 03eccf9db3ab2..fb7eddf6afae4 100644 --- a/src/ui/public/promises/promises.js +++ b/src/ui/public/promises/promises.js @@ -71,7 +71,7 @@ module.service('Promise', function ($q, $timeout) { }); Promise.try = function (fn, args, ctx) { if (typeof fn !== 'function') { - return Promise.reject('fn must be a function'); + return Promise.reject(new TypeError('fn must be a function')); } var value;