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

Unified Diff: Source/devtools/front_end/platform/utilities.js

Issue 1196193016: DevTools: [CSS] promisify CSS domain (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 5 years, 6 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
Index: Source/devtools/front_end/platform/utilities.js
diff --git a/Source/devtools/front_end/platform/utilities.js b/Source/devtools/front_end/platform/utilities.js
index ea7a2859cb598d0b6fa2459abf511deec6b4c29d..824b61b6004c2b63a1408cc63f628f38cd795154 100644
--- a/Source/devtools/front_end/platform/utilities.js
+++ b/Source/devtools/front_end/platform/utilities.js
@@ -1483,3 +1483,15 @@ Promise.prototype.spread = function(callback)
return callback.apply(null, arg);
}
}
+
+/**
+ * @param {T} defaultValue
+ * @return {!Promise.<T>}
+ * @template T
+ */
+Promise.prototype.catchException = function(defaultValue) {
+ return this.catch(function (error) {
+ console.error(error);
+ return defaultValue;
+ });
+}
« no previous file with comments | « Source/devtools/front_end/elements/StylesSidebarPane.js ('k') | Source/devtools/front_end/sdk/CPUProfilerModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698