diff --git a/lib/swagger.js b/lib/swagger.js index c9d12d136..ba28b91cf 100644 --- a/lib/swagger.js +++ b/lib/swagger.js @@ -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 = {