Skip to content

Commit

Permalink
error object format
Browse files Browse the repository at this point in the history
  • Loading branch information
openhoat committed Oct 14, 2015
1 parent 1ec6d0d commit e6828ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/hw-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ that = {
data = error.schemaErrors;
if (Array.isArray(data)) {
data = data.map(function (item) {
return _.omit(_.extend(item, {code: 'BAD_FORMAT'}), ['instanceContext', 'resolutionScope', 'kind']);
var result = _.omit(_.extend(item, {code: 'BAD_FORMAT'}), ['instanceContext', 'resolutionScope', 'kind', 'desc']);
if (item.desc) {
result.message = item.desc;
}
return result;
});
}
} else if (error.message) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hw-error",
"version": "0.0.5",
"version": "0.0.6",
"description": "Better error management",
"main": "lib/hw-error.js",
"author": "Olivier Penhoat <openhoat@gmail.com> (http://headwood.net/)",
Expand Down

0 comments on commit e6828ec

Please sign in to comment.