Skip to content

Commit

Permalink
feat: SentryExceptionHandling (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoasterFreakDE authored Apr 24, 2024
1 parent e3452c9 commit 95a6733
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/net/blockventuremc/utils/RegisterManager.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.blockventuremc.utils

import io.sentry.Sentry
import net.blockventuremc.BlockVenture
import net.blockventuremc.annotations.BlockCommand
import net.blockventuremc.consts.NAMESPACE_PLUGIN
Expand Down Expand Up @@ -38,6 +39,7 @@ object RegisterManager {
commandInstance.onCommand(sender, command, label, args)
} catch (e: Exception) {
sender.sendMessagePrefixed("An error occurred while executing the command.")
Sentry.captureException(e)
throw e
}
}
Expand Down Expand Up @@ -73,8 +75,10 @@ object RegisterManager {
.sendMessage("Listener ${event.javaClass.simpleName} registered")
} catch (exception: InstantiationError) {
exception.printStackTrace()
Sentry.captureException(exception)
} catch (exception: IllegalAccessException) {
exception.printStackTrace()
Sentry.captureException(exception)
}
}
}
Expand Down

0 comments on commit 95a6733

Please sign in to comment.