Fix #185: need more detailed SSL error message

This commit is contained in:
Sefa Ilkimen
2019-02-22 19:20:12 +01:00
parent 1fd857f1d9
commit 807400bc63
7 changed files with 6382 additions and 25 deletions
@@ -270,11 +270,11 @@ abstract class CordovaHttp {
protected void handleHttpRequestException(HttpRequestException e) {
if (e.getCause() instanceof UnknownHostException) {
this.respondWithError(0, "The host could not be resolved");
this.respondWithError(0, "The host could not be resolved: " + e.getMessage());
} else if (e.getCause() instanceof SocketTimeoutException) {
this.respondWithError(1, "The request timed out");
this.respondWithError(1, "The request timed out: " + e.getMessage());
} else if (e.getCause() instanceof SSLHandshakeException) {
this.respondWithError("SSL handshake failed");
this.respondWithError(-2, "SSL handshake failed: " + e.getMessage());
} else {
this.respondWithError("There was an error with the request: " + e.getMessage());
}