From ee3b9e3bf76e2f4b28d1fcbabeb040c1281347d2 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 5 Jan 2022 09:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/Exceptions.kt | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/Exceptions.kt b/app/src/main/java/io/legado/app/model/Exceptions.kt index 01a0026df..9edcaace7 100644 --- a/app/src/main/java/io/legado/app/model/Exceptions.kt +++ b/app/src/main/java/io/legado/app/model/Exceptions.kt @@ -2,12 +2,10 @@ package io.legado.app.model -class AppException(msg: String) : Exception(msg) - /** - * + * 不记录错误堆栈的报错 */ -class NoStackTraceException(msg: String) : Exception(msg) { +open class NoStackTraceException(msg: String) : Exception(msg) { override fun fillInStackTrace(): Throwable { return this @@ -18,32 +16,14 @@ class NoStackTraceException(msg: String) : Exception(msg) { /** * 目录为空 */ -class TocEmptyException(msg: String) : Exception(msg) { - - override fun fillInStackTrace(): Throwable { - return this - } - -} +class TocEmptyException(msg: String) : NoStackTraceException(msg) /** * 内容为空 */ -class ContentEmptyException(msg: String) : Exception(msg) { - - override fun fillInStackTrace(): Throwable { - return this - } - -} +class ContentEmptyException(msg: String) : NoStackTraceException(msg) /** * 并发限制 */ -class ConcurrentException(msg: String, val waitTime: Int) : Exception(msg) { - - override fun fillInStackTrace(): Throwable { - return this - } - -} \ No newline at end of file +class ConcurrentException(msg: String, val waitTime: Int) : NoStackTraceException(msg) \ No newline at end of file