Index: chrome/browser/resources/gallery/js/util.js |
diff --git a/chrome/browser/resources/gallery/js/util.js b/chrome/browser/resources/gallery/js/util.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..21151e325cdddbb4b777fb5cbc6d09e7e59f7c39 |
--- /dev/null |
+++ b/chrome/browser/resources/gallery/js/util.js |
@@ -0,0 +1,15 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+'use strict'; |
+ |
+/** |
+ * Shows an error message if the promise is rejected. |
+ * @param {Promise} promise Promise |
+ */ |
+function trackPromise(promise) { |
+ promise.catch(function(error) { |
+ console.error(error.stack || error); |
+ }); |
+} |