mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
fix #40: generic error codes are different on Android and iOS
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user