|
@@ -2507,8 +2507,7 @@ public class FileDisplayActivity extends FileActivity
|
|
|
setUser(user);
|
|
|
|
|
|
if (fileId == null) {
|
|
|
- dismissLoadingDialog();
|
|
|
- DisplayUtils.showSnackMessage(this, getString(R.string.error_retrieving_file));
|
|
|
+ onFileRequestError(null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2529,8 +2528,7 @@ public class FileDisplayActivity extends FileActivity
|
|
|
setUser(user);
|
|
|
|
|
|
if (filepath == null) {
|
|
|
- dismissLoadingDialog();
|
|
|
- DisplayUtils.showSnackMessage(this, getString(R.string.error_retrieving_file));
|
|
|
+ onFileRequestError(null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2544,8 +2542,7 @@ public class FileDisplayActivity extends FileActivity
|
|
|
try {
|
|
|
client = clientFactory.create(user);
|
|
|
} catch (ClientFactory.CreationException e) {
|
|
|
- dismissLoadingDialog();
|
|
|
- DisplayUtils.showSnackMessage(this, getString(R.string.error_retrieving_file));
|
|
|
+ onFileRequestError(null);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2554,9 +2551,16 @@ public class FileDisplayActivity extends FileActivity
|
|
|
client,
|
|
|
storageManager,
|
|
|
user);
|
|
|
- asyncRunner.postQuickTask(getRemoteFileTask, this::onFileRequestResult, null);
|
|
|
+ asyncRunner.postQuickTask(getRemoteFileTask, this::onFileRequestResult, this::onFileRequestError);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Unit onFileRequestError(Throwable throwable) {
|
|
|
+ dismissLoadingDialog();
|
|
|
+ DisplayUtils.showSnackMessage(this, getString(R.string.error_retrieving_file));
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private Unit onFileRequestResult(GetRemoteFileTask.Result result) {
|
|
|
dismissLoadingDialog();
|
|
|
|