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

Unified Diff: chrome/browser/resources/file_manager/common/js/util.js

Issue 163083002: Files.app: Show error messages for the case the source file is not exists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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: chrome/browser/resources/file_manager/common/js/util.js
diff --git a/chrome/browser/resources/file_manager/common/js/util.js b/chrome/browser/resources/file_manager/common/js/util.js
index afc29fabf76880fe322c7b0836f3eddb53122fc5..0eab9227c3248359e970485b847d080cda04b145 100644
--- a/chrome/browser/resources/file_manager/common/js/util.js
+++ b/chrome/browser/resources/file_manager/common/js/util.js
@@ -1150,9 +1150,12 @@ util.entriesToURLs = function(entries) {
* @param {Array.<string>} urls Input array of URLs.
* @param {function(Array.<Entry>)} callback Completion callback with array of
* Entries.
yoshiki 2014/02/14 10:24:11 Please mention that the both errorCallback and cal
hirono 2014/02/14 10:42:37 Let me combine the callbacks!
+ * @param {function(Array.<Entry>)} opt_errorCallback Error callback with array
+ * of URLs failed to be resolved.
*/
-util.URLsToEntries = function(urls, callback) {
+util.URLsToEntries = function(urls, callback, opt_errorCallback) {
var result = [];
+ var failureUrl = [];
AsyncUtil.forEach(
urls,
function(forEachCallback, url) {
@@ -1162,11 +1165,14 @@ util.URLsToEntries = function(urls, callback) {
}, function() {
// Not an error. Possibly, the file is not accessible anymore.
console.warn('Failed to resolve the file with url: ' + url + '.');
+ failureUrl.push(url);
forEachCallback();
});
},
function() {
callback(result);
+ if (opt_errorCallback)
+ opt_errorCallback(failureUrl);
});
};

Powered by Google App Engine
This is Rietveld 408576698