Commit f989cd93 authored by Him188's avatar Him188

Multiplatform Exceptions to deal with kotlin bug

parent 5eb731e9
package net.mamoe.mirai.contact
/**
* 权限不足
*/
actual class PermissionDeniedException : IllegalStateException {
actual constructor() : super("Permission denied")
actual constructor(message: String?) : super(message)
}
\ No newline at end of file
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)
}
\ No newline at end of file
package net.mamoe.mirai.contact
/**
* 权限不足
*/ // 不要删除多平台结构
actual class PermissionDeniedException : IllegalStateException {
actual constructor() : super("Permission denied")
actual constructor(message: String?) : super(message)
}
\ No newline at end of file
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)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment