Skip to content

Commit

Permalink
Fix #12. Adds friendly path to property on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dschenkelman committed Oct 9, 2014
1 parent b4a04c9 commit 59fc55b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/RequestValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ var RequestValidator = function(plugin, options) {
var report, errorMessages,
extractErrorMessage = function(error) {
var message = (error.description) ? error.message + '. Description: ' + error.description : error.message;
message += ' - on ';
// handles array case with second replacement
message += error.path.substr(2).replace(/\//g, '.').replace(/\.\[/g, '[');

return message;
};

Expand Down

0 comments on commit 59fc55b

Please sign in to comment.