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

quant not exiting with correct error code #95

Closed
ATpoint opened this issue Jan 8, 2023 · 2 comments
Closed

quant not exiting with correct error code #95

ATpoint opened this issue Jan 8, 2023 · 2 comments

Comments

@ATpoint
Copy link

ATpoint commented Jan 8, 2023

Hi Rob,

I think here there is an std::process::exit(1); missing. I just had a run with this error but it still exited with error code 0 rather than 1. Version 0.8.0

alevin-fry quant -t 1 -i sample1 -o quant_fry --tg-map splici_t2g_3col.tsv --resolution cr-like --use-mtx && echo "OK" || echo "FAIL"

...returned this error (because I messed up providing the permit files properly) but also the "OK" echo. Can you double-check, I think this should be an exit of 1.

@rob-p
Copy link
Contributor

rob-p commented Jan 8, 2023

Hi @ATpoint,

You're right that the exit code isn't set properly in this case. At some point, we switched from the "historic" unit return type for main (where all non-zero exit codes had to result from a std::process::exit) to the more modern Result<()> return type for main. Some code paths (like this one, I believe) slipped through the cracks. It seems it wants to print the error message, but that doesn't prevent it from returning 0 (i.e. returning Ok(()) from main). I think the right thing to do here is to ensure in this path that we return Err(<appropriate error message here>), which will both show the message and force the exit code to 1.

Thanks!
Rob

rob-p pushed a commit that referenced this issue Jan 8, 2023
@rob-p
Copy link
Contributor

rob-p commented Jan 13, 2023

Fixed in 0.8.1.

@rob-p rob-p closed this as completed Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants