mirror of
https://github.com/nerzhul/ownCloud-SMS-App.git
synced 2025-06-07 16:06:18 +00:00
Version 2.0.2: fetch last http error issue properly from low level go client
This commit is contained in:
parent
95d2bfe8f9
commit
f2348d0a46
@ -21,8 +21,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "fr.unix_experience.owncloud_sms"
|
||||
versionCode 65
|
||||
versionName "2.0.1"
|
||||
versionCode 66
|
||||
versionName "2.0.2"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 27
|
||||
maxSdkVersion 27
|
||||
@ -32,11 +32,6 @@ android {
|
||||
abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a',
|
||||
'arm64-v8a', 'mips', 'mips64'
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags "-frtti -fexceptions -std=c++11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
Binary file not shown.
@ -261,6 +261,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
Log.i(TAG, "_serverURL = " + serverURL);
|
||||
_login = login;
|
||||
_password = password;
|
||||
_last_http_error = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -278,6 +279,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
_returnCode = 599;
|
||||
}
|
||||
|
||||
_last_http_error = http.getLastError();
|
||||
return (_returnCode == 200);
|
||||
}
|
||||
|
||||
@ -325,7 +327,12 @@ public class LoginActivity extends AppCompatActivity {
|
||||
boolean serverViewRequestFocus = true;
|
||||
switch (_returnCode) {
|
||||
case 0:
|
||||
_serverView.setError("UNK");
|
||||
if (!_last_http_error.isEmpty()) {
|
||||
_serverView.setError("Low level error: " + _last_http_error);
|
||||
}
|
||||
else {
|
||||
_serverView.setError("Unknown error");
|
||||
}
|
||||
break;
|
||||
case 404:
|
||||
_serverView.setError(getString(R.string.error_connection_failed_not_found));
|
||||
@ -371,6 +378,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
private final URL _serverURL;
|
||||
private final String _login;
|
||||
private final String _password;
|
||||
private String _last_http_error;
|
||||
private int _returnCode;
|
||||
|
||||
static final String PARAM_AUTHTOKEN_TYPE = "auth.token";
|
||||
|
@ -52,6 +52,10 @@ public class OCHttpClient {
|
||||
}
|
||||
}
|
||||
|
||||
public String getLastError() {
|
||||
return _smsHttpClient.getLastError();
|
||||
}
|
||||
|
||||
Pair<Integer, SmsIDListResponse> getAllSmsIds() throws OCSyncException {
|
||||
SmsIDListResponse silr = _smsHttpClient.doGetSmsIDList();
|
||||
int httpStatus = (int) _smsHttpClient.getLastHTTPStatus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user