From eb9581e65549ffd5b7cefeea44008f76f037c224 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 25 Oct 2021 15:40:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96toast=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/service/HttpReadAloudService.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index eda18ee5c..00f49746a 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -26,6 +26,7 @@ import java.io.IOException import java.net.ConnectException import java.net.SocketTimeoutException import java.util.* +import javax.script.ScriptException class HttpReadAloudService : BaseReadAloudService(), MediaPlayer.OnPreparedListener, @@ -167,6 +168,12 @@ class HttpReadAloudService : BaseReadAloudService(), } catch (e: ConcurrentException) { removeSpeakCache(fileName) downloadAudio() + } catch (e: ScriptException) { + AppLog.put("tts接口错误\n${e.localizedMessage}", e) + toastOnUi("js错误\n${e.localizedMessage}") + Timber.e(e) + cancel() + stopSelf() } catch (e: SocketTimeoutException) { removeSpeakCache(fileName) downloadErrorNo++