Merge pull request #3574 from nextcloud/serverUnavailable

Server unavailable
This commit is contained in:
Andy Scherzinger 2019-02-12 21:23:49 +01:00 committed by GitHub
commit db96ceec25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 9 deletions

View file

@ -1411,14 +1411,28 @@ public class FileDisplayActivity extends HookActivity
// TODO refactor and make common
if (checkForRemoteOperationError(synchResult)) {
requestCredentialsUpdate(context);
} else if (RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(
synchResult.getCode())) {
showUntrustedCertDialog(synchResult);
} else if (ResultCode.MAINTENANCE_MODE.equals(synchResult.getCode())) {
showInfoBox(R.string.maintenance_mode);
} else if (ResultCode.NO_NETWORK_CONNECTION.equals(synchResult.getCode()) ||
ResultCode.HOST_NOT_AVAILABLE.equals(synchResult.getCode())) {
showInfoBox(R.string.offline_mode);
} else {
switch (synchResult.getCode()) {
case SSL_RECOVERABLE_PEER_UNVERIFIED:
showUntrustedCertDialog(synchResult);
break;
case MAINTENANCE_MODE:
showInfoBox(R.string.maintenance_mode);
break;
case NO_NETWORK_CONNECTION:
showInfoBox(R.string.offline_mode);
break;
case HOST_NOT_AVAILABLE:
showInfoBox(R.string.host_not_available);
break;
default:
// nothing to do
break;
}
}
}
}

View file

@ -826,7 +826,6 @@
<string name="no_pdf_app_available">No App available to handle PDF</string>
<string name="share_via_link_hide_download">Hide download</string>
<string name="unread_comments">Unread comments exist</string>
<string name="richdocuments_failed_to_load_document">Failed to load document!</string>
<string name="create_new_document">Create new document</string>
<string name="create_new_spreadsheet">Create new spreadsheet</string>
@ -854,5 +853,6 @@
<string name="upload_sync_conflict">Sync conflict, please resolve manually</string>
<string name="upload_cannot_create_file">Cannot create local file</string>
<string name="upload_local_storage_not_copied">File could not be copied to local storage</string>
<string name="host_not_available">Server not available</string>
<string name="delete_entries">Delete entries</string>
</resources>