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

Raise qualified exceptions instead of generic 'Exception' #103

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

Gulin7
Copy link
Contributor

@Gulin7 Gulin7 commented Nov 27, 2024

Fix: #91

Changes:

  • used built-in Exceptions instead of generic 'Exception' or created custom Exceptions

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 55.17241% with 13 lines in your changes missing coverage. Please review.

Project coverage is 43.66%. Comparing base (92fafb1) to head (b35f11c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
scraper/src/mindtouch2zim/asset.py 14.28% 6 Missing ⚠️
scraper/src/mindtouch2zim/html_rewriting.py 0.00% 3 Missing ⚠️
scraper/src/mindtouch2zim/client.py 33.33% 2 Missing ⚠️
scraper/src/mindtouch2zim/processor.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
+ Coverage   43.14%   43.66%   +0.51%     
==========================================
  Files          15       15              
  Lines         978      987       +9     
  Branches      133      133              
==========================================
+ Hits          422      431       +9     
  Misses        545      545              
  Partials       11       11              

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

Copy link
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

Thank you! Please move all to the errors.py as you've suggested, good for me otherwise.

And fix your first comment in the PR to link the PR and the issue: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue (e.g. Fix #xxx instead of Issue: #xxx). This way the issue will be automatically closed when PR is merged.

@Gulin7
Copy link
Contributor Author

Gulin7 commented Nov 27, 2024

I have fixed my PR comment and moved the custom exceptions to errors.py .

@benoit74 benoit74 self-requested a review November 27, 2024 13:10
Copy link
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@benoit74 benoit74 merged commit d63320e into openzim:main Nov 27, 2024
10 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.

Do not raise generic Exception, prefer qualified exception
2 participants