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

Return exception info from with_dodal_module and with_plan_module #726

Open
dperl-dls opened this issue Nov 21, 2024 · 2 comments
Open

Return exception info from with_dodal_module and with_plan_module #726

dperl-dls opened this issue Nov 21, 2024 · 2 comments

Comments

@dperl-dls
Copy link
Contributor

Recently importing our plans (mx-bluesky/hyperion) into the BlueApi context started failing with a new (2.10) version of pydantic, which when running create_model on the plan arguments fails when one is a dataclasses.dataclass containing devices, because the devices don't implement __get_pydantic_core_schema__. This would have been substantially easier to diagnose if we had the information that exceptions had occurred during the above functions available to us when running them

Acceptance Criteria

these methods have return values that allow the caller to determine if an exception happened and some info about it

@callumforrester
Copy link
Contributor

@DiamondJoseph is this related to #727?

@dperl-dls
Copy link
Contributor Author

dperl-dls commented Nov 22, 2024

@callumforrester yes, related in the sense that we weren't getting errors from these above-mentioned functions when setting up our context, with plans that take dataclass device-composite args, but I can imagine other situations where it'd be useful too

For reference, we do this: https://github.com/DiamondLightSource/mx-bluesky/blob/f3a358c3e1b3e2947f1c18b5b7dfee4462010166/src/mx_bluesky/hyperion/utils/context.py#L73-L84 and it'd be nice to know if something went wrong at that point

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