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

cli pull: Print errors instead of panicking when pulling invalid spec files #753

Open
midigofrank opened this issue Aug 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@midigofrank
Copy link
Contributor

Currently this is what gets logged:

[CLI] ♦ Downloading the project spec (as YAML) from the server.

[CLI] ✘ Command failed!
[CLI] ✘ Error: Document with errors cannot be stringified
    at Document.toString (/opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@openfn/cli/node_modules/yaml/dist/doc/Document.js:321:19)
    at extractJobsToDisk (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@openfn/cli/node_modules/@openfn/deploy/dist/index.js:626:14)
    at async pullHandler (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@openfn/cli/dist/process/runner.js:1587:25)
    at async parse (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@openfn/cli/dist/process/runner.js:1764:12)

Related to OpenFn/lightning#2446

The YAML parser tracks these errors, can we pretty print them instead? https://eemeli.org/yaml/#errors

@christad92 christad92 added the bug Something isn't working label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: New Issues
Development

No branches or pull requests

2 participants