-
-
Notifications
You must be signed in to change notification settings - Fork 281
refactor: use custom exception for error handling #201
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
Conversation
The error code used is embedded into these exceptions
b5b0709
to
8a51843
Compare
Codecov Report
@@ Coverage Diff @@
## master #201 +/- ##
==========================================
+ Coverage 92.14% 95.64% +3.49%
==========================================
Files 35 34 -1
Lines 968 942 -26
==========================================
+ Hits 892 901 +9
+ Misses 76 41 -35
Continue to review full report at Codecov.
|
…validCommandArgumentError Instead of using SystemExit, we raise these error as CommitizenException
@woile I've finished the major part of this refactoring. Could you please take a look at it? 🙂 I'm still working on the error message part. I'll also add documentation for these error codes. |
06ad77c
to
68b7d69
Compare
3fc7d3a
to
69ce10c
Compare
…en --debug flag is used
69ce10c
to
fb888fe
Compare
fb888fe
to
4a1b89b
Compare
…tag in changelog are different
04a65c8
to
5dfdeeb
Compare
… Bump prefix these errors are only for `cz bump`
@woile This pr is finally ready for reviewing 🎉 |
the error code used is embedded into these exceptions
(Thanks for sending a pull request! Please fill in the following content to let us know better about this change.)
Types of changes
Please put an
x
in the box that appliesDescription
CommitizenException
DryRunExit
,ExpectedExit
,NoCommandFoundError
,InvalidCommandArgumentError
(Remove all theSystemExit
)NO_COMMIT_MSG
error codeTODO
CommitizenException
(e.g. git group, command line group and etc.)Checklist:
./script/lint
and./script/test
locally to ensure this change passes linter check and testSteps to Test This Pull Request
Try to execute the commands that will raise exceptions. e.g.,
cz bump --dry-run
Expected behavior
No behavior should change after this change
Related Issue
#128
Additional context
Add any other context or screenshots about the pull request here.