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

Add an option to run tasks so they raise an error during the run #890

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

oliche
Copy link
Member

@oliche oliche commented Nov 29, 2024

Currently tasks catch errors and output the traceback.
For some manual processing and or scripts, it is useful to halt execution and raise during the task.

The on_error parameter at the init stage is set to continue by default, and can be set to raise to achieve this behaviour.

@oliche
Copy link
Member Author

oliche commented Nov 29, 2024

Look at run_alyx tasks that may benefit from using this

@k1o0
Copy link
Contributor

k1o0 commented Nov 29, 2024

Look at run_alyx tasks that may benefit from using this

task.cleanUp()
if mode == 'raise' and status != 0:
raise ValueError(task.log)

Interestingly this cleans up the task before re-raising

@oliche oliche merged commit 1382460 into develop Dec 2, 2024
6 checks passed
@oliche oliche deleted the tasks branch December 2, 2024 11:41
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

Successfully merging this pull request may close these issues.

2 participants