-
Notifications
You must be signed in to change notification settings - Fork 634
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(fs): throw Deno.errors.NotSupported
instead of SubdirectoryMoveError
in move[Sync]()
#5532
Conversation
…rors.InvalidData`
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5532 +/- ##
==========================================
- Coverage 96.51% 96.51% -0.01%
==========================================
Files 465 465
Lines 37714 37705 -9
Branches 5576 5576
==========================================
- Hits 36400 36391 -9
Misses 1272 1272
Partials 42 42 ☔ View full report in Codecov by Sentry. |
SubdirectoryMoveError
exception with Deno.errors.InvalidData
Deno.errors.InvalidData
instead of SubdirectoryMoveError
in move[Sync]()
Is this worth the breaking change? |
How about
Yes. It's one less extraneous symbol that the user has to import. |
This doesn't sound a good reason for breaking change. There are many symbols we can remove if we optimize for fewer number of symbols. |
Perhaps, we're asking the wrong question. I think the question we should be asking is: why should we have a custom |
Ok. I changed my mind. Let's do this change, but let's use |
Deno.errors.InvalidData
instead of SubdirectoryMoveError
in move[Sync]()
Deno.errors.NotSupported
instead of SubdirectoryMoveError
in move[Sync]()
Great! Updated. |
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,
@std/fs/move
threwSubdirectoryMoveError
. Now, it throwsDeno.errors.NotSupported
.Motivation
This change was made to reduce the API surface area by using an appropriate error class that's already built into the Deno runtime.
Migration guide
To migrate, compare against
Deno.error.NotSupported
instead ofSubdirectoryMoveError
when error-handlingmove()
ormoveSync()
.Related
Towards #5476