Skip to content

Commit

Permalink
errors.js: Add r.errors.create method
Browse files Browse the repository at this point in the history
Makes creating errors consistent with the formatting of API errors on
the client side easier.
  • Loading branch information
Matt Lee committed Oct 7, 2016
1 parent 45b7989 commit 8fb3e91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions r2/r2/public/static/js/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@


r.errors = {
create: function(name, message, field, source) {
return new ApiError(name, message, field, source);
},

formatAPIError: function(apiErrorArray) {
var key = apiErrorArray[0];
var message = apiErrorArray[1];
Expand Down

0 comments on commit 8fb3e91

Please sign in to comment.