Skip to content

Commit

Permalink
command reader: Use fast exception
Browse files Browse the repository at this point in the history
The stacktrace is mostly never read, just the message is print. This makes the cli output way cleaner and improves performance.
  • Loading branch information
Bixilon committed Feb 2, 2024
1 parent a80ced4 commit fb1f460
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* 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.
*
Expand All @@ -13,12 +13,13 @@

package de.bixilon.minosoft.commands.errors

import de.bixilon.kutil.exception.FastException
import de.bixilon.minosoft.commands.util.StringReader

abstract class ReaderError(
val reader: StringReader,
val start: Int,
val end: Int,
) : Exception() {
) : FastException() {
override val message: String = "${this::class.simpleName} at $start-$end: ${reader.string} (at ${reader.string.substring(start, end)})"
}

0 comments on commit fb1f460

Please sign in to comment.