diff options
author | Tomasz Grobelny <tomasz@grobelny.net> | 2018-11-15 17:51:03 +0100 |
---|---|---|
committer | Tomasz Grobelny <tomasz@grobelny.net> | 2018-11-24 23:55:42 +0100 |
commit | 8e240d1197fbd4cf43882532e86501e2ba87551f (patch) | |
tree | 6f806543e9225866bf6681015c6a30d77b72887d /apps | |
parent | 1f6f276fa02533a696fc4157f061a4482be02917 (diff) | |
download | nextcloud-server-8e240d1197fbd4cf43882532e86501e2ba87551f.tar.gz nextcloud-server-8e240d1197fbd4cf43882532e86501e2ba87551f.zip |
Properly handle errors (including 500)
Signed-off-by: Tomasz Grobelny <tomasz@grobelny.net>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 1891cbff5dc..5b3a47e3e0a 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2250,6 +2250,10 @@ return this.reportOperationProgress(fileNames, moveFileFunction, callback); }, + _reflect: function (promise){ + return promise.then(function(v){ return {}}, function(e){ return {}}); + }, + reportOperationProgress: function (fileNames, operationFunction, callback){ var self = this; self._operationProgressBar.showProgressBar(false); @@ -2257,7 +2261,7 @@ var counter = 0; var promises = _.map(fileNames, function(arg) { return mcSemaphore.acquire().then(function(){ - return operationFunction(arg).then(function(){ + return operationFunction(arg).always(function(){ mcSemaphore.release(); counter++; self._operationProgressBar.setProgressBarValue(100.0*counter/fileNames.length); @@ -2265,7 +2269,7 @@ }); }); - return Promise.all(promises).then(function(){ + return Promise.all(_.map(promises, self._reflect)).then(function(){ if (callback) { callback(); } |