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

feat: make ErrorType enums compare as strings #269

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

agners
Copy link
Collaborator

@agners agners commented Nov 21, 2023

The DBusError exception stores the error type as string. This makes the exception not directly compare to the ErrorType members (for example DBusError(ErrorType.FAILED, "").type != ErrorType.FAILED). This makes ErrorType also a string to make this comparision work.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1586221) 83.34% compared to head (2a23330) 83.28%.
Report is 3 commits behind head on main.

Files Patch % Lines
src/dbus_fast/__version__.py 0.00% 1 Missing ⚠️
src/dbus_fast/service.py 50.00% 0 Missing and 1 partial ⚠️
src/dbus_fast/signature.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
- Coverage   83.34%   83.28%   -0.06%     
==========================================
  Files          28       28              
  Lines        3290     3291       +1     
  Branches      682      682              
==========================================
- Hits         2742     2741       -1     
- Misses        331      335       +4     
+ Partials      217      215       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@agners agners force-pushed the make-error-type-inhert-str branch from 47e64fc to f6a3cbf Compare November 21, 2023 22:57
@agners agners force-pushed the make-error-type-inhert-str branch from 9d2b26b to 14be83e Compare November 21, 2023 23:10
The DBusError exception stores the error type as string. This makes the
exception not directly compare to the ErrorType members (for example
DBusError(ErrorType.FAILED, "").type != ErrorType.FAILED). This makes
ErrorType also a string to make this comparision work.
@agners agners force-pushed the make-error-type-inhert-str branch from 14be83e to 2a23330 Compare November 21, 2023 23:11
@bdraco bdraco changed the title Make ErrorType enums compare as strings feat: make ErrorType enums compare as strings Nov 21, 2023
@bdraco
Copy link
Member

bdraco commented Nov 21, 2023

I put this on my production Bluetooth env, and tested with bleak. I didn't see anything in the logs or unexpected side effects.

The tests look good so feel free to merge if you are ready

@agners agners merged commit c6a8301 into main Nov 22, 2023
17 of 19 checks passed
@agners agners deleted the make-error-type-inhert-str branch November 22, 2023 08:26
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