1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 * Invokes a callback function depending on the result of promise.
8 * @param {Promise} promise Promise.
9 * @param {function(boolean)} calllback Callback function. True is passed if the
12 function reportPromise(promise, callback) {
13 promise.then(function() {
14 callback(/* error */ false);
16 console.error(error.stack || error);
17 callback(/* error */ true);