mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 07:20:04 -04:00
command reader: Use fast exception
The stacktrace is mostly never read, just the message is print. This makes the cli output way cleaner and improves performance.
This commit is contained in:
parent
a80ced4cf1
commit
fb1f460d5d
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -13,12 +13,13 @@
|
|||||||
|
|
||||||
package de.bixilon.minosoft.commands.errors
|
package de.bixilon.minosoft.commands.errors
|
||||||
|
|
||||||
|
import de.bixilon.kutil.exception.FastException
|
||||||
import de.bixilon.minosoft.commands.util.StringReader
|
import de.bixilon.minosoft.commands.util.StringReader
|
||||||
|
|
||||||
abstract class ReaderError(
|
abstract class ReaderError(
|
||||||
val reader: StringReader,
|
val reader: StringReader,
|
||||||
val start: Int,
|
val start: Int,
|
||||||
val end: Int,
|
val end: Int,
|
||||||
) : Exception() {
|
) : FastException() {
|
||||||
override val message: String = "${this::class.simpleName} at $start-$end: ${reader.string} (at ${reader.string.substring(start, end)})"
|
override val message: String = "${this::class.simpleName} at $start-$end: ${reader.string} (at ${reader.string.substring(start, end)})"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user