diff --git a/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/BaseRoute.kt b/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/BaseRoute.kt index 474095612..002bf0716 100644 --- a/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/BaseRoute.kt +++ b/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/BaseRoute.kt @@ -130,15 +130,15 @@ internal inline fun Route.miraiVerify( internal inline fun Route.intercept(crossinline blk: suspend PipelineContext.() -> Unit) = handle { try { blk(this) - } catch (e: IllegalSessionException) { + } catch (e: IllegalSessionException) { // Session过期 call.respondStateCode(StateCode.IllegalSession) - } catch (e: NotVerifiedSessionException) { + } catch (e: NotVerifiedSessionException) { // Session未认证 call.respondStateCode(StateCode.NotVerifySession) - } catch (e: NoSuchBotException) { + } catch (e: NoSuchBotException) { // Bot不存在 call.respondStateCode(StateCode.NoBot) - } catch (e: NoSuchElementException) { + } catch (e: NoSuchElementException) { // 指定对象不存在 call.respondStateCode(StateCode.NoElement) - } catch (e: PermissionDeniedException) { + } catch (e: PermissionDeniedException) { // 缺少权限 call.respondStateCode(StateCode.PermissionDenied) } catch (e: IllegalAccessException) { call.respondStateCode(StateCode(400, e.message), HttpStatusCode.BadRequest)