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

fix: pass return value to SendReply.__exit__ #127

Merged
merged 1 commit into from
Oct 29, 2022

Conversation

dlech
Copy link
Collaborator

@dlech dlech commented Oct 29, 2022

To return an error in a ServiceInterface, you raise a DBusError which is caught and translated to a message and sent over the bus. However, the context manager that catches this exception was incorrectly not sending a return value of True when the exception was handled. This caused the _message_reader() returned by build_message_reader() to log the error even though it was handled.

@codecov
Copy link

codecov bot commented Oct 29, 2022

Codecov Report

Base: 81.85% // Head: 81.65% // Decreases project coverage by -0.19% ⚠️

Coverage data is based on head (fe91cb6) compared to base (8f6a431).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   81.85%   81.65%   -0.20%     
==========================================
  Files          27       27              
  Lines        3091     3091              
  Branches      597      597              
==========================================
- Hits         2530     2524       -6     
- Misses        342      347       +5     
- Partials      219      220       +1     
Impacted Files Coverage Δ
src/dbus_fast/message_bus.py 71.00% <100.00%> (-0.38%) ⬇️
src/dbus_fast/aio/message_reader.py 90.90% <0.00%> (-9.10%) ⬇️
src/dbus_fast/glib/message_bus.py 80.32% <0.00%> (-0.82%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

To return an error in a ServiceInterface, you raise a DBusError which
is caught and translated to a message and sent over the bus. However,
the context manager that catches this exception was incorrectly not
sending a return value of True when the exception was handled. This
caused the _message_reader() returned by build_message_reader() to
log the error even though it was handled.
@dlech dlech force-pushed the fix-dbus-error-not-supressed branch from b62f5b8 to fe91cb6 Compare October 29, 2022 23:36
Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bdraco bdraco merged commit f8c67ed into main Oct 29, 2022
@bdraco bdraco deleted the fix-dbus-error-not-supressed branch October 29, 2022 23:43
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