Skip to content

Commit

Permalink
Print error location
Browse files Browse the repository at this point in the history
  • Loading branch information
kminami committed Mar 24, 2022
1 parent 50dcfe6 commit 3c0ace1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bin/apib2swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ function processBlueprint(blueprint, opts) {
};
apib2swagger.convert(blueprint, options, function(error, result) {
if (error) {
if (error.stack && error.result) {
// override toString() of drafter's error to expand error.result.error.location
console.log(error.stack);
console.log(JSON.stringify(error.result, 0, 2));
return;
}
console.log(error);
return;
}
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": "apib2swagger",
"version": "1.14.1",
"version": "1.14.2",
"description": "Convert API Blueprint to Swagger.",
"bin": "./bin/apib2swagger.js",
"scripts": {
Expand Down

0 comments on commit 3c0ace1

Please sign in to comment.