fix #40: generic error codes are different on Android and iOS

This commit is contained in:
Sefa Ilkimen
2017-11-07 13:31:38 +01:00
parent 068b25b6f9
commit e987652d97
5 changed files with 21 additions and 17 deletions
@@ -161,7 +161,7 @@ abstract class CordovaHttp {
}
protected void respondWithError(String msg) {
this.respondWithError(500, msg);
this.respondWithError(-1, msg);
}
protected void addResponseHeaders(HttpRequest request, JSONObject response) throws JSONException {
@@ -241,7 +241,7 @@ abstract class CordovaHttp {
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
this.respondWithError("There was an error with the request: " + e.getMessage());
}
}
}
@@ -57,7 +57,7 @@ class CordovaHttpDelete extends CordovaHttp implements Runnable {
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
} else {
this.respondWithError("There was an error with the request");
this.respondWithError("There was an error with the request: " + e.getMessage());
}
} catch (Exception e) {
this.respondWithError(-1, e.getMessage());