Skip to content

Use concrete built-in exceptions instead of Exception base class #169

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

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Feb 23, 2022

Fixes #168.

Instead of using the Exception base class, use concrete built-in IndexError, TypeError and ValueError instead.

https://docs.python.org/3/library/exceptions.html

Allows more targeted exception catching.

@hugovk hugovk added the changelog: Added For new features label Feb 23, 2022
@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #169 (d1d9d55) into master (f7c1f43) will not change coverage.
The diff coverage is 39.39%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #169   +/-   ##
=======================================
  Coverage   93.42%   93.42%           
=======================================
  Files           5        5           
  Lines        2130     2130           
=======================================
  Hits         1990     1990           
  Misses        140      140           
Flag Coverage Δ
GHA_Ubuntu 93.42% <39.39%> (ø)
GHA_Windows 93.28% <39.39%> (ø)
GHA_macOS 93.42% <39.39%> (ø)

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

Impacted Files Coverage Δ
src/prettytable/prettytable.py 89.48% <23.07%> (ø)
tests/test_prettytable.py 100.00% <100.00%> (ø)

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 f7c1f43...d1d9d55. Read the comment docs.

@hugovk hugovk mentioned this pull request Feb 23, 2022
@fawaf
Copy link

fawaf commented Feb 23, 2022

:shipit:

@hugovk hugovk merged commit 75263dd into prettytable:master Feb 23, 2022
@hugovk hugovk deleted the built-in-exceptions branch February 23, 2022 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use custom exception type
2 participants