-
Notifications
You must be signed in to change notification settings - Fork 40
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
refactor(CordovaError)!: remove unused features #117
refactor(CordovaError)!: remove unused features #117
Conversation
Codecov Report
@@ Coverage Diff @@
## master #117 +/- ##
==========================================
+ Coverage 86.26% 86.91% +0.65%
==========================================
Files 21 20 -1
Lines 1558 1529 -29
==========================================
- Hits 1344 1329 -15
+ Misses 214 200 -14
Continue to review full report at Codecov.
|
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.
👍
I hope we can look into adding the reason
code soon, ideally in multiple places, as suggested in the description.
Moves the `CordovaError` module from `src/CordovaError/CordovaError.js` to `src/CordovaError.js`. The additional nesting makes no sense anymore since `src/CordovaError/CordovaExternalToolErrorContext.js` has been removed in #117.
Motivation and Context
CordovaError
implements a lot of features that we do not use anywhere in our code base. I also find these features of little use. This PR removes them.The result is an
Error
subclass that does nothing except for stripping theError:
prefix from the usual result ofError.prototype.toString
. Thus we should probably discuss if we want to removeCordovaError
completely in the future or extend it with useful functionality.One thing that would be actually useful is accepting a second parameter
reason
of typeError
like in Java. That way it's easy to add information when catching an error and re-throwing it. Actually, the one place in our code that constructs aCordovaError
with more than one argument tries to do exactly that. Unfortunately that's not how the constructor works currently.Of course this change is a breaking one and non-Apache cordova-common consumers would be affected by it as well. However, I don't expect there to be many that use
CordovaError
.Description
Removed features:
toString
Testing