Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: report parse failure reasons #1058

Merged

Conversation

michael-ball-ctct
Copy link
Contributor

Description

Adds simple logging for parsing failures, to improve debugging speed and experience of incorrectly formatted asyncapi.yml files for users.

I opted for the more basic logging style of the two I mentioned in the issue - 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 or adding overcomplicated presence-checking logic (as well as including all available information, regardless of what is provided).

Related issue(s)

Resolves #1051

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

For [](asyncapi#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).
@michael-ball-ctct michael-ball-ctct changed the title feat: Report parse failure reasons feat: report parse failure reasons Oct 30, 2023
lib/generator.js Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Nov 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarcloud bot commented Jan 4, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok to merge it this way. I quickly checked on local what effect error logs will have on AsyncAPI CLI and looks good

Sorry it took so long but nov/dec was AsyncAPI v3 release and then usual holidays

@derberg
Copy link
Member

derberg commented Jan 4, 2024

/rtm

@asyncapi-bot asyncapi-bot merged commit 028fbea into asyncapi:master Jan 4, 2024
14 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@derberg
Copy link
Member

derberg commented Jan 4, 2024

@allcontributors please add @michael-ball-ctct for code

Copy link
Contributor

@derberg

Could not find the user michael-ball#/#ctct on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report parse failure reasons
3 participants