-
Notifications
You must be signed in to change notification settings - Fork 629
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
BREAKING(testing): replace TimeError
exception in favor of built-in error classes in some cases
#5550
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5550 +/- ##
=======================================
Coverage 96.48% 96.48%
=======================================
Files 465 465
Lines 37772 37772
Branches 5580 5580
=======================================
Hits 36445 36445
Misses 1285 1285
Partials 42 42 ☔ View full report in Codecov by Sentry. |
@KyleJune, does this change seem reasonable to you? |
Seems reasonable to me. I don't have any issues with this change. |
TimeError
in favor of built-in error classesTimeError
exception in favor of built-in error classes in some cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's changed
Previously, all exceptions within
FakeTime
threwTimeError
s. Now, some exceptions throwRangeError
s, andTypeError
s, depending on the nature of the error.@throws
JSDoc tags have also been added to the documentation.Motivation
This change was made for two main reasons:
FakeTime
.FakeTime
.Migration guide
To migrate, when error-handling
FakeTime
, use the appropriate error class for the given error message (see table below for reference)."Invalid start time"
TypeError
"Time cannot go backwards"
RangeError
Related
Towards #5476