Skip to content

Commit

Permalink
Better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed May 28, 2019
1 parent d91ef8b commit f55f5a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ exports.run = function({ args, opts }) {
}

function error(err) {
console.log(err.error);
return Promise.reject(new Error('There was an error uploading!'));
try {
return Promise.reject(new Error(JSON.parse(err.error).description));
} catch(e) {
return Promise.reject(new Error('There was an error uploading!'));
}
}

const options = {
Expand Down

0 comments on commit f55f5a6

Please sign in to comment.