mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5e3ffafd5a
@ -18,6 +18,9 @@ import net.mamoe.mirai.console.command.descriptor.CommandArgumentParserException
|
||||
*
|
||||
* [message] 将会发送给指令调用方.
|
||||
*
|
||||
* 如果指令调用方是 [ConsoleCommandSender],
|
||||
* 还会将 [cause], [suppressedExceptions] 发送给 [ConsoleCommandSender] (如果存在)
|
||||
*
|
||||
* @see CommandArgumentParserException
|
||||
*/
|
||||
public open class IllegalCommandArgumentException : IllegalArgumentException {
|
||||
|
@ -62,7 +62,16 @@ internal fun startupConsoleThread() {
|
||||
is Success -> {
|
||||
}
|
||||
is IllegalArgument -> {
|
||||
result.exception.message?.let { consoleLogger.warning(it) } ?: kotlin.run {
|
||||
result.exception.message?.let { msg ->
|
||||
val err = result.exception
|
||||
if ((err.suppressed?.size ?: 0) != 0) {
|
||||
// 该 IllegalArgument 错误还存在其他附加错误
|
||||
consoleLogger.warning(result.exception)
|
||||
} else {
|
||||
consoleLogger.warning(msg)
|
||||
err.cause?.let { consoleLogger.warning(it) }
|
||||
}
|
||||
} ?: kotlin.run {
|
||||
consoleLogger.warning(result.exception)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user