From fafdde61c520ac09c374aad3c97c9b8c1c34422f Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Sun, 19 Nov 2023 15:21:34 +0100 Subject: [PATCH] fix(android): return more httpclient errors to Ti (#13947) --- .../src/java/ti/modules/titanium/network/TiHTTPClient.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java index 933bd75a0f7..d3c04b4f916 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java @@ -1371,7 +1371,11 @@ public void progress(int progress) } catch (IOException e) { if (!aborted) { - throw e; + KrollDict data = new KrollDict(); + data.putCodeAndMessage((getStatus() >= 400) ? getStatus() : TiC.ERROR_CODE_UNKNOWN, + e.getMessage()); + dispatchCallback(TiC.PROPERTY_ONERROR, data); + return; } } finally { if (client != null) {