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

Add handling of forbidden errors from here api response #78

Merged
merged 2 commits into from
May 17, 2024

Conversation

James-Burgess
Copy link
Contributor

@James-Burgess James-Burgess commented May 16, 2024

Looks like with the new update from here, there's a new "Forbidden" response if you have not set up you account with billing.

Added in a quick block to handle that error.

Decided on duplicating the code into an elif over error in ["forbidden", "unauth"]
Main choice was to keep things a bit simpler and not nest too much logic in one line...

Happy to jump in and give the whole block a clean if that will help get this in :)

@abdullahselek
Copy link
Owner

Thanks for raising this, it's simple as you said but if you have time a clean implementation would be better. And also a new test case 🙂

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.25%. Comparing base (8fc6b96) to head (f12eecb).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   93.24%   93.25%           
=======================================
  Files          26       26           
  Lines        1733     1735    +2     
=======================================
+ Hits         1616     1618    +2     
  Misses        117      117           
Flag Coverage Δ
unittests 93.25% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Owner

@abdullahselek abdullahselek left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@abdullahselek abdullahselek merged commit 0e31aea into abdullahselek:master May 17, 2024
22 checks passed
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.

3 participants