[
https://issues.apache.org/jira/browse/CB-12433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857245#comment-15857245
]
Kerri Shotts commented on CB-12433:
-----------------------------------
Can you show an example where you would benefit from this change? I'm not
saying this isn't a good idea -- I'm just curious about your use case(s).
Also -- did any of this come from a Stack Overflow answer? If so, that needs to
be duly attributed. (Not saying it did -- just that /if it did/, the
attribution is needed.)
> Make FileError extends native Error
> -----------------------------------
>
> Key: CB-12433
> URL: https://issues.apache.org/jira/browse/CB-12433
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Plugin File
> Reporter: Jan Doležel
> Priority: Minor
>
> {code}
> diff --git a/www/FileError.js b/www/FileError.js
> index 6507921..eb681d6 100644
> --- a/www/FileError.js
> +++ b/www/FileError.js
> @@ -24,8 +24,17 @@
> */
> function FileError(error) {
> this.code = error || null;
> +
> + this.name = this.constructor.name;
> + if (typeof Error.captureStackTrace === 'function') {
> + Error.captureStackTrace(this, this.constructor);
> + } else {
> + this.stack = (new Error(error)).stack;
> + }
> }
> +FileError.prototype = new Error();
> +
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]