Skip to content

Commit ce456c9

Browse files
committed
update to Traverson 5.0.0, set error.name
1 parent 6c358a5 commit ce456c9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
],
2121
"license": "MIT",
2222
"scripts": {
23-
"test": "grunt"
23+
"test": "grunt",
24+
"build": "grunt"
2425
},
2526
"keywords": [
2627
"JSON",
@@ -33,7 +34,7 @@
3334
"AngularJS"
3435
],
3536
"dependencies": {
36-
"traverson": "^3.1.1"
37+
"traverson": "^5.0.0"
3738
},
3839
"devDependencies": {
3940
"angular": "^1.3.4",

traverson-angular.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ traversonAngular.factory('traverson',
5959
deferred.promise.then(function() {
6060
deferredContinue.resolve(traversal.continue());
6161
}, function() {
62-
throw new Error('Can\'t continue from a broken traversal.');
62+
var error = new Error('Can\'t continue from a broken traversal.');
63+
error.name = 'InvalidStateError';
64+
throw error;
6365
});
6466
return deferredContinue.promise;
6567
}
@@ -275,7 +277,9 @@ AbortHandle.prototype.abort = function() {
275277

276278
AbortHandle.prototype.on = function(event, fn) {
277279
if (event !== 'abort') {
278-
throw new Error('Event ' + event + ' not supported');
280+
var error = new Error('Event ' + event + ' not supported');
281+
error.name = 'InvalidArgumentError';
282+
throw error;
279283
}
280284
this.listeners.push(fn);
281285
};

0 commit comments

Comments
 (0)