[app] Temporarily fix #169

This commit is contained in:
LoveSy 2021-02-23 08:43:08 +08:00
parent a556880228
commit ceb70aea3b
1 changed files with 24 additions and 16 deletions

View File

@ -25,6 +25,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@ -86,6 +87,7 @@ public class RepoLoader {
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
try {
ResponseBody body = response.body();
if (body != null) {
String bodyString = body.string();
@ -103,6 +105,12 @@ public class RepoLoader {
isLoading = false;
repoLoaded = true;
}
} catch (Throwable e) {
if (e instanceof IOException)
throw e;
else
throw new IOException(e.getMessage(), e.getCause());
}
}
});
}