From 0c92c83ccccb035db748a3c77e79a9b1379a8a58 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 12 Nov 2023 20:25:43 +0100 Subject: [PATCH] DeepL: use HttpStatusException --- app/src/main/java/eu/faircode/email/DeepL.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/DeepL.java b/app/src/main/java/eu/faircode/email/DeepL.java index b78cead617..798c60d8f6 100644 --- a/app/src/main/java/eu/faircode/email/DeepL.java +++ b/app/src/main/java/eu/faircode/email/DeepL.java @@ -47,6 +47,7 @@ import com.google.android.material.textfield.TextInputLayout; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import org.jsoup.HttpStatusException; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; @@ -275,7 +276,7 @@ public class DeepL { } catch (Throwable ex) { Log.w(ex); } - throw new IOException(error); + throw new HttpStatusException(error, status, url.toString()); } String response = Helper.readStream(connection.getInputStream());