mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
handle exceptions
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
cfd5bc29c0
commit
d903b9151e
1 changed files with 11 additions and 4 deletions
|
@ -132,6 +132,7 @@ import java.util.Set;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
import java.util.concurrent.RejectedExecutionException;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
@ -982,7 +983,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Future<Pair<Integer, OCFile>> getPreviousFile() {
|
private Future<Pair<Integer, OCFile>> getPreviousFile() throws NullPointerException, RejectedExecutionException {
|
||||||
CompletableFuture<Pair<Integer, OCFile>> completableFuture = new CompletableFuture<>();
|
CompletableFuture<Pair<Integer, OCFile>> completableFuture = new CompletableFuture<>();
|
||||||
|
|
||||||
Executors.newCachedThreadPool().submit(() -> {
|
Executors.newCachedThreadPool().submit(() -> {
|
||||||
|
@ -1026,9 +1027,15 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
||||||
mFile = result.second;
|
mFile = result.second;
|
||||||
updateFileList();
|
updateFileList();
|
||||||
return result.first;
|
return result.first;
|
||||||
} catch (java.util.concurrent.ExecutionException | java.lang.InterruptedException e) {
|
} catch (java.util.concurrent.ExecutionException | java.lang.InterruptedException | NullPointerException |
|
||||||
Log_OC.e(TAG,"Error caught at onBrowseUp: " + e);
|
RejectedExecutionException e) {
|
||||||
return 0;
|
Log_OC.e(TAG,"Error caught in onBrowseUp " + e + " getPreviousFileWithoutFilter() used: ");
|
||||||
|
|
||||||
|
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
||||||
|
var result = getPreviousFileWithoutFilter(storageManager);
|
||||||
|
mFile = result.second;
|
||||||
|
updateFileList();
|
||||||
|
return result.first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue