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

errorStrategy advice with exit status > 0 #2992

Closed
MaestSi opened this issue Jun 27, 2022 · 2 comments
Closed

errorStrategy advice with exit status > 0 #2992

MaestSi opened this issue Jun 27, 2022 · 2 comments

Comments

@MaestSi
Copy link

MaestSi commented Jun 27, 2022

Dear all,
I am currently integrating TRF in a NextFlow pipeline. However, with the tool's version I'm currently using "TRF would have a non-zero exit status which was to be interpreted by the user as the number of TRs processed". I tried using errorStrategy = 'ignore', but it seems it is not doing what I would like it to do, as it is not allowing the remaining part of the process to be executed (consisting of other runs of TRF with different parameters). Is there a way I can manage to avoid this issue?
Thanks in advance,
Simone

@bentsherman
Copy link
Member

Nextflow used to have a validExitStatus directive that allowed you to specify which exit codes should be considered successful. But that directive was deprecated and removed because I think it had some issues.

The recommended way to handle this kind of problem is to add some bash logic to your process script, such that it returns a 0 exit code at the end. For example:

bash -c 'exit 2' || echo "processed $? TRs"

The first bash command represents a process that returns a non-zero exit code, and I use or (||) to "catch" that exit code, print it, and return 0 exit code like normal.

@MaestSi
Copy link
Author

MaestSi commented Jun 27, 2022

Thank you very much, that worked like a charm!
Simone

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