You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jan Doležel (JIRA)" <ji...@apache.org> on 2017/02/07 11:33:41 UTC
[jira] [Updated] (CB-12433) Make FileError extends native Error
[ https://issues.apache.org/jira/browse/CB-12433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Doležel updated CB-12433:
-----------------------------
Description:
{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}
> 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org