Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Carolina VillalonCarolina VillalonReporter
Tiago RibeiroTiago RibeiroReviewers
Tiago RibeiroStory Points
1RubinTeam
CommissioningComponents
Sprint
None
Details
Details
Assignee
Carolina Villalon
Carolina VillalonReporter
Tiago Ribeiro
Tiago RibeiroReviewers
Tiago Ribeiro
Story Points
1
RubinTeam
Commissioning
Components
Sprint
None
Checklist
Checklist
Checklist
Created September 24, 2024 at 3:20 PM
Updated September 30, 2024 at 6:26 PM
Resolved September 30, 2024 at 6:26 PM
Currently, in
ATCalSys.prepare_for_flat
there is agather
statement here, that runs the setup tasks concurrently. When there is an error in any of the coroutines, the error message is obfuscated and does not show which task failed.I think the best way to improve this is to have the exceptions be returned and then process the errors individually. Luckily,
asyncio.gather
returns in the same order they are passed so something like this should work:ret_val = await asyncio.gather( task_setup_monochromator, task_setup_latiss, task_setup_electrometer, return_exceptions=True, ) operations = ["Setup monochromator", "Setup latiss", "Setup electrometer"] exceptions = [(operation, val) for (operation, val) in zip(operations, ret_val) if isinstance(val, Exception)] if exceptions: err_message = f"{len(exceptions)} out of {len(operations)} failed.\n" for (operation, exception) in expcetions: err_message += f"{operation} failed with {exception}.\n" raise RuntimeError(err_message)