-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Missing file error message ends up on STDOUT #6749
Comments
This is an error coming from the rego package and it's handled differently. This is why it goes to stdout. This is printed by the presentation package. We can probably change this behavior based on whether the result contains an error. |
Agreed, this is unexpected, and stderr would be the right channel for output here. If we "always" did this, I suppose there's a real risk that there are scripts out there relying on finding the error message on stdout? But since the |
Another option would be to make this configurable and default to stdout. |
Short description
Using opa against a non existent rego files returns with an error message on STDOUT and errcode 2.
I would think such an error really should be sent to STDERR. We struggled with this in a pipeline because STDOUT was consumed.
Steps To Reproduce
Expected behavior
$ ./opa eval --format pretty --data file.rego tfplan.json > /dev/null
1 error occurred: stat file.rego: no such file or directory
Additional context
The text was updated successfully, but these errors were encountered: