mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-01 03:50:18 +08:00
Multiplatform Exceptions to deal with kotlin bug
This commit is contained in:
parent
5eb731e975
commit
f989cd9391
@ -0,0 +1,9 @@
|
||||
package net.mamoe.mirai.contact
|
||||
|
||||
/**
|
||||
* 权限不足
|
||||
*/
|
||||
actual class PermissionDeniedException : IllegalStateException {
|
||||
actual constructor() : super("Permission denied")
|
||||
actual constructor(message: String?) : super(message)
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package net.mamoe.mirai.event.events
|
||||
|
||||
@Suppress("unused")
|
||||
actual class EventCancelledException : RuntimeException {
|
||||
actual constructor() : super()
|
||||
actual constructor(message: String?) : super(message)
|
||||
actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||
actual constructor(cause: Throwable?) : super(cause)
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package net.mamoe.mirai.contact
|
||||
|
||||
/**
|
||||
* 权限不足
|
||||
*/ // 不要删除多平台结构
|
||||
actual class PermissionDeniedException : IllegalStateException {
|
||||
actual constructor() : super("Permission denied")
|
||||
actual constructor(message: String?) : super(message)
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package net.mamoe.mirai.event.events
|
||||
|
||||
|
||||
// 不要删除跨平台结构.
|
||||
// 否则在 Java 中这个 class 不会被认为是 java.lang.RuntimeException (Kotlin bug)
|
||||
@Suppress("unused")
|
||||
actual class EventCancelledException : RuntimeException {
|
||||
actual constructor() : super()
|
||||
actual constructor(message: String?) : super(message)
|
||||
actual constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||
actual constructor(cause: Throwable?) : super(cause)
|
||||
}
|
Loading…
Reference in New Issue
Block a user