From 4ea0bc893742dc53feaddcf31bc37917ce2375a5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 15 May 2020 18:11:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/http/HttpHelper.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 31064e268..173a450c1 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -43,7 +43,11 @@ object HttpHelper { val response = getApiService(baseUrl, encode) .get(url, mapOf()) .execute() - return response.body() + return if (response.body() != null) { + response.body() + } else { + response.errorBody().toString() + } } return null }