LanguageTool: use HttpStatusException

pull/214/head
M66B 10 months ago
parent 0c92c83ccc
commit ea9c2cd2e5

@ -60,6 +60,7 @@ import com.google.android.material.snackbar.Snackbar;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -687,7 +688,7 @@ public class FragmentAnswer extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
Throwable exex = new Throwable("LanguageTool", ex);
Log.unexpectedError(getParentFragmentManager(), exex, false);
Log.unexpectedError(getParentFragmentManager(), exex, !(ex instanceof IOException));
}
}.execute(this, args, "answer:lt");
}

@ -3018,7 +3018,7 @@ public class FragmentCompose extends FragmentBase {
protected void onException(Bundle args, Throwable ex) {
if (!silent) {
Throwable exex = new Throwable("LanguageTool", ex);
Log.unexpectedError(getParentFragmentManager(), exex, false);
Log.unexpectedError(getParentFragmentManager(), exex, !(ex instanceof IOException));
}
}
}.execute(this, args, "compose:lt");

@ -39,6 +39,7 @@ import androidx.preference.PreferenceManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.HttpStatusException;
import java.io.IOException;
import java.io.InputStream;
@ -472,7 +473,7 @@ public class LanguageTool {
Log.w(ex);
}
Log.w("LT " + error);
throw new IOException(error);
throw new HttpStatusException(error, status, connection.getURL().toString());
}
}

Loading…
Cancel
Save