Skip to content

Commit

Permalink
feat: report parse failure reasons
Browse files Browse the repository at this point in the history
For [](#1051)

I opted for the more basic logging style - I don't know enough about
the diagnostics objects to be sure that they'll always contain the same
fields, so erred on the side of caution rather than trying to access
fields within fields that aren't guaranteed to exist (as well as
including all available information, regardless of what is provided).
  • Loading branch information
michael-ball-ctct committed Oct 30, 2023
1 parent 3dc4e9e commit 7c98c25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ class Generator {
if (!document) {
const err = new Error('Input is not a correct AsyncAPI document so it cannot be processed.');
err.diagnostics = diagnostics;
for (const diag of diagnostics) {
console.error('Diagnotic err:', diag);
}
throw err;
} else {
this.asyncapi = document;
Expand Down

0 comments on commit 7c98c25

Please sign in to comment.