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

Use specific error status for missing .envrc #470

Open
Profpatsch opened this issue Mar 6, 2019 · 5 comments
Open

Use specific error status for missing .envrc #470

Profpatsch opened this issue Mar 6, 2019 · 5 comments

Comments

@Profpatsch
Copy link
Contributor

For editor integration like https://github.com/wbolster/emacs-direnv to be able to provide a nice user interface, they need to be able to discern the different failure states, like a missing .envrc and possibly others.

Of course they could match on the error message, but a nicer way is to have more specific failure status codes, e.g. “missing .envrc” would get status 2.

@zimbatm
Copy link
Member

zimbatm commented Mar 8, 2019

Happy to get a PR that classifies all the possible error types

@curiousleo
Copy link
Contributor

Starting point:

direnv/main.go

Line 19 in f697949

os.Exit(1)

@zimbatm
Copy link
Member

zimbatm commented Oct 22, 2019

Basically you would introduce an type ErrorWithStatus struct { Err error, ExitStatus int } and then type-switch on that during exit. Maybe a table of exit statuses could also be built.

@curiousleo
Copy link
Contributor

This could be used as a starting point for the actual exit code numbers: https://www.freebsd.org/cgi/man.cgi?query=sysexits&apropos=0&sektion=0&manpath=FreeBSD+11.2-stable&arch=default&format=html

@zimbatm
Copy link
Member

zimbatm commented Oct 23, 2019

Now all we need is for somebody to actually implement it :p

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

No branches or pull requests

3 participants