|
|
@ -65,14 +65,13 @@ public class DeepL {
|
|
|
|
|
|
|
|
|
|
|
|
int status = connection.getResponseCode();
|
|
|
|
int status = connection.getResponseCode();
|
|
|
|
if (status != HttpsURLConnection.HTTP_OK) {
|
|
|
|
if (status != HttpsURLConnection.HTTP_OK) {
|
|
|
|
String error;
|
|
|
|
String error = "Error " + status + ": " + connection.getResponseMessage();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
error = Helper.readStream(connection.getErrorStream());
|
|
|
|
error += "\n" + Helper.readStream(connection.getErrorStream());
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.w(ex);
|
|
|
|
Log.w(ex);
|
|
|
|
error = ex.getMessage();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new FileNotFoundException("Error " + status + ": " + error);
|
|
|
|
throw new FileNotFoundException(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String response = Helper.readStream(connection.getInputStream());
|
|
|
|
String response = Helper.readStream(connection.getInputStream());
|
|
|
|