From 3591e43deea4fa1cc253cdd715d8c03d920e3e78 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 8 Mar 2023 20:39:51 +0100 Subject: [PATCH] Revert "OpenAI: improved error handling" This reverts commit 6b819dcd6464d3713264aae58632bf7ce2789816. --- app/src/main/java/eu/faircode/email/OpenAI.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/OpenAI.java b/app/src/main/java/eu/faircode/email/OpenAI.java index 3461049757..44716738d6 100644 --- a/app/src/main/java/eu/faircode/email/OpenAI.java +++ b/app/src/main/java/eu/faircode/email/OpenAI.java @@ -115,17 +115,8 @@ public class OpenAI { String error = "Error " + status + ": " + connection.getResponseMessage(); try { InputStream is = connection.getErrorStream(); - if (is != null) { - json = Helper.readStream(is); - Log.w(json); - try { - JSONObject jresponse = new JSONObject(json); - JSONObject jerror = jresponse.getJSONObject("error"); - error += "\n" + jerror.getString("type") + ": " + jerror.getString("message"); - } catch (JSONException e) { - error += "\n" + json; - } - } + if (is != null) + error += "\n" + Helper.readStream(is); } catch (Throwable ex) { Log.w(ex); }