From 6ab2d7e4c04578c53ac071bdc58c9074ab1bb502 Mon Sep 17 00:00:00 2001 From: Karlatemp <karlatemp@vip.qq.com> Date: Sun, 18 Jul 2021 23:08:22 +0800 Subject: [PATCH] Flatten `NetworkException` --- .../handler/selector/NetworkException.kt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/network/handler/selector/NetworkException.kt b/mirai-core/src/commonMain/kotlin/network/handler/selector/NetworkException.kt index fa31b3f92..f28bfe846 100644 --- a/mirai-core/src/commonMain/kotlin/network/handler/selector/NetworkException.kt +++ b/mirai-core/src/commonMain/kotlin/network/handler/selector/NetworkException.kt @@ -9,9 +9,21 @@ package net.mamoe.mirai.internal.network.handler.selector -internal abstract class NetworkException( +internal abstract class NetworkException : Exception { /** * If true, the selector may recover the network handler by some means. */ - val recoverable: Boolean, -) : Exception() \ No newline at end of file + val recoverable: Boolean + + constructor(recoverable: Boolean) : super() { + this.recoverable = recoverable + } + + constructor(message: String, recoverable: Boolean) : super(message) { + this.recoverable = recoverable + } + + constructor(message: String, cause: Throwable?, recoverable: Boolean) : super(message, cause) { + this.recoverable = recoverable + } +}