Skip to content

Commit

Permalink
Merge pull request #2670 from SrGaabriel/main
Browse files Browse the repository at this point in the history
Optimize exception generation during command execution
  • Loading branch information
MrPowerGamerBR authored Nov 18, 2024
2 parents c630baf + e5346b3 commit e4e3040
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import net.perfectdreams.loritta.morenitta.messages.LorittaReply
*
* The [reply] construtor parameter is used to notify the user about the issue.
*/
class CommandException(val reply: LorittaReply) : RuntimeException() {
class CommandException(val reply: LorittaReply) : RuntimeException(null, null, false, false) {
constructor(reason: String, prefix: String) : this(LorittaReply(reason, prefix))
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ package net.perfectdreams.loritta.morenitta.api.commands
*
* Used when the code already explained to the user the issue and the flow should be halted.
*/
class SilentCommandException : RuntimeException()
class SilentCommandException : RuntimeException(null, null, false, false)
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import dev.minn.jda.ktx.messages.InlineMessage
*
* Implementations should catch this exception and send the [builder], logging the error is not required.
*/
class CommandException(val ephemeral: Boolean, val builder: InlineMessage<*>.() -> (Unit)) : RuntimeException()
class CommandException(val ephemeral: Boolean, val builder: InlineMessage<*>.() -> (Unit)) : RuntimeException(null, null, false, false)

0 comments on commit e4e3040

Please sign in to comment.