Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: Source/devtools/front_end/Runtime.js

Issue 645513004: [DevTools] Report error in debug mode from promise with stack (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/common/utilities.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/Runtime.js
diff --git a/Source/devtools/front_end/Runtime.js b/Source/devtools/front_end/Runtime.js
index ff5c54f9298e5e7d4d77e1f3d39eb44739724fd8..ab97e926029d80bb5088cd207a49a62c82a40528 100644
--- a/Source/devtools/front_end/Runtime.js
+++ b/Source/devtools/front_end/Runtime.js
@@ -987,14 +987,27 @@ Promise.prototype.thenOrCatch = function(callback)
*/
function reject(e)
{
- console.error(e);
+ if (e instanceof Error)
+ console.error(e.stack);
+ else
+ console.error(e);
callback();
}
}
Promise.prototype.done = function()
{
- this.catch(console.error.bind(console));
+ /**
+ * @param {*} e
+ */
+ function reportError(e)
+ {
+ if (e instanceof Error)
+ console.error(e.stack);
+ else
+ console.error(e);
+ }
+ this.catch(reportError);
}
/**
« no previous file with comments | « no previous file | Source/devtools/front_end/common/utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698