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

misleading error handling when yaml declaration cannot be validated #15

Open
amolari opened this issue Apr 1, 2021 · 1 comment
Open
Labels
enhancement New feature or request
Milestone

Comments

@amolari
Copy link

amolari commented Apr 1, 2021

Issue: error handling if the yaml declaration is not correctly loaded

While the yaml declaration may pass validation on some popular Internet yaml validators (copy/paste), it may goes in error when loaded with

config = yaml.safeLoad(fs.readFileSync(program.configFile, 'utf8'));

Example: a tab instead of spaces in the declaration

After the changes made here:
d805e9a#diff-fa8d4e24d8399e8350f1c8bad05df53e8032ea995835bf911507015e2db61cdd

the process is to load the declaration as a json if the yaml safeload went in error. That will of course produce an error, which can be confusing.
If the yaml safeload went in error, an explicit error indicating the yaml validation issue (eventually not blocking, if you want to try to load the config as json) should be thrown in the log.

@shyawnkarim
Copy link

Thanks for reporting this issue. We are now tracking this internally with ID ESECLDTPLT-2548.

@shyawnkarim shyawnkarim added the enhancement New feature or request label Apr 1, 2021
@shyawnkarim shyawnkarim added this to the backlog milestone Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants