Skip to content

Commit

Permalink
Send the value when sending the error
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Apr 29, 2014
1 parent d172d60 commit 1c9d84c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/convert.js
Expand Up @@ -45,10 +45,11 @@ function convert (options, value) {
}

if (value && value.constructor.name !== 'Date' && type === 'date') {

value = moment(value, options.parse || undefined).toDate();

if (isNaN(value.valueOf())) {
return new Error('Date conversion failed:');
return new Error('Date conversion failed: ' + value);
}

return value;
Expand Down

0 comments on commit 1c9d84c

Please sign in to comment.