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

bubble up the error message / improve error message when failing to parse the schema #269

Merged
merged 1 commit into from
Aug 8, 2020

Conversation

BlooJeans
Copy link
Contributor

Two small things:

  1. If you fail to load the spec, then return early. Otherwise the swaggerToTS function will attempt to execute and obviously fail, giving you a misleading error message

  2. Bubble up the error message returned from yaml.safeLoad() to give you an idea of why the script is failing

Before:
Screenshot_20200608_104708

After:
Screenshot_20200608_104615

Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Thank you! Agree this is an improvement.

@drwpow drwpow merged commit f9c3667 into openapi-ts:master Aug 8, 2020
@drwpow
Copy link
Contributor

drwpow commented Aug 8, 2020

@all-contributors please add @BlooJeans for code

@allcontributors
Copy link
Contributor

@drwpow

I've put up a pull request to add @BlooJeans! 🎉

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

Successfully merging this pull request may close these issues.

2 participants