mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +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.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
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<>();
|
||||
|
||||
Executors.newCachedThreadPool().submit(() -> {
|
||||
|
@ -1026,9 +1027,15 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
mFile = result.second;
|
||||
updateFileList();
|
||||
return result.first;
|
||||
} catch (java.util.concurrent.ExecutionException | java.lang.InterruptedException e) {
|
||||
Log_OC.e(TAG,"Error caught at onBrowseUp: " + e);
|
||||
return 0;
|
||||
} catch (java.util.concurrent.ExecutionException | java.lang.InterruptedException | NullPointerException |
|
||||
RejectedExecutionException e) {
|
||||
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