mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2026-08-21 21:32:58 +00:00
Handle Error#15 when ocsms is not install or owncloud is awaiting upgrade
This commit is contained in:
@@ -354,8 +354,15 @@ public class OCSMSOwnCloudClient {
|
||||
respJSON = new JSONObject(response);
|
||||
} catch (final JSONException e) {
|
||||
if (skipError == false) {
|
||||
Log.e(TAG, "Unable to parse server response", e);
|
||||
throw new OCSyncException(R.string.err_sync_http_request_parse_resp, OCSyncErrorType.PARSE);
|
||||
if (response.contains("ownCloud") && response.contains("DOCTYPE")) {
|
||||
Log.e(TAG, "OcSMS app not enabled or ownCloud upgrade is required");
|
||||
throw new OCSyncException(R.string.err_sync_ocsms_not_installed_or_oc_upgrade_required,
|
||||
OCSyncErrorType.SERVER_ERROR);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, "Unable to parse server response", e);
|
||||
throw new OCSyncException(R.string.err_sync_http_request_parse_resp, OCSyncErrorType.PARSE);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public class SmsSyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
|
||||
// and push datas
|
||||
_client.doPushRequest(null);
|
||||
|
||||
nMgr.dropSyncErrorMsg();
|
||||
} catch (final OCSyncException e) {
|
||||
nMgr.setSyncErrorMsg(getContext().getString(e.getErrorId()));
|
||||
|
||||
Reference in New Issue
Block a user