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

ERL-1338: escript errors should go to standard error not standard output #4403

Closed
OTP-Maintainer opened this issue Sep 6, 2020 · 3 comments
Assignees
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: mikael pettersson
Affected version: Not Specified
Fixed in version: OTP-24.0
Component: erts
Migrated from: https://bugs.erlang.org/browse/ERL-1338


The expectation of a command-line tool is that errors are printed to standard error, leaving standard output for normal non-erroneous output.

However if an escript fails (its main/1 throws an exception), escript:start/1 prints its error diagnostics to standard output.

I would prefer that escript.erl printed all errors to standard error, but I suspect that backwards compatibility prevents that.  An alternative could be to introduce an option to the escript program, e.g. "-e", which would direct all its errors to standard error.
@OTP-Maintainer
Copy link
Author

lukas said:

We agreed that this would be nice. It should be ok to break backward compatibility for this.

We'll take a look when time allows. As always a PR would be much appreciated.

@OTP-Maintainer
Copy link
Author

mikael pettersson said:

[PR|https://github.com/erlang/otp/pull/2748] opened

@OTP-Maintainer
Copy link
Author

lukas said:

PR merged for release in OTP-24

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:medium labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-24.0 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants