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 error handling issues #95

Merged
merged 5 commits into from
Oct 19, 2021
Merged

Fix error handling issues #95

merged 5 commits into from
Oct 19, 2021

Conversation

blairlunceford
Copy link
Contributor

Fix bug reported in:

#94
#93

@blairlunceford blairlunceford requested a review from a team as a code owner October 19, 2021 19:09
workos/__about__.py Outdated Show resolved Hide resolved
@maxdeviant
Copy link
Contributor

@blairlunceford Could we add a test case that exhibits the broken behavior and passes with the changes?

@@ -82,6 +82,27 @@ def test_bad_request_exceptions_include_expected_request_data(
# This'll fail for sure here but... just using the nice error that'd come up
assert ex.__class__ == BadRequestException

def test_bad_request_exceptions_exclude_expected_request_data(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this test gives us the proper coverage.

I tried running this test locally without the fix and it still passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I've been looking at all of these tests, and I don't think any of them are doing the right things. Trying to figure this out - hoping my Ruby translates to Python 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the latest changes, I was able to run locally without the fix and see the error AttributeError: 'BadRequestException' object has no attribute 'error' and when I added the fix, the tests pass.

@codecov-commenter
Copy link

Codecov Report

Merging #95 (4a38959) into master (722a468) will increase coverage by 2.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
+ Coverage   93.01%   95.51%   +2.49%     
==========================================
  Files          17       17              
  Lines         401      401              
==========================================
+ Hits          373      383      +10     
+ Misses         28       18      -10     
Impacted Files Coverage Δ
workos/exceptions.py 94.44% <100.00%> (+27.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 722a468...4a38959. Read the comment docs.

@blairlunceford blairlunceford merged commit bf9608f into master Oct 19, 2021
@blairlunceford blairlunceford deleted the bug-fix-error-handling branch October 19, 2021 21:35
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.

None yet

3 participants