-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix(components): try catch subscription callbacks #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good addition indeed, just a suggestion on how we could perhaps address this
source/modulo_components/include/modulo_components/ComponentInterface.hpp
Show resolved
Hide resolved
c171e28
to
799ac2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! thanks for adding the tests, I missed them in the previous review
799ac2b
to
1708724
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is a nice thing for now to prevent unhandled exceptions. We can think about additional user requirements from there, but a user could also raise_error manually from within their callback so I think it's already quite good!
1708724
to
63a62e5
Compare
Description
This PR improves the robustness of the component interfaces by try catching subscription callbacks in all cases. Until now, we "only" try catched additional user callbacks.
One might argue that we should only catch
CoreException
and not all exceptions as the user might want to throw exceptions on purpose but I can not imagine a setup where one would desire to throw an exception in a subscription callback.Also, we could put the component in error state by putting the
raise_error
there but that as well, I'm just not sure if I want to introduce it, since we'd have to do that consistently in all theadd_input
variants. I like the idea of subscription callbacks just failing with a throttled log instead of raising the error on the component.Review guidelines
Estimated Time of Review: 5 minutes
Checklist before merging: