mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
error logging and bstats simple pie
This commit is contained in:
parent
3e68af06ea
commit
48f0cab15d
9 changed files with 37 additions and 9 deletions
|
|
@ -22,7 +22,6 @@ import xyz.alexcrea.cuanvil.listener.PrepareAnvilListener
|
|||
import xyz.alexcrea.cuanvil.update.ModrinthUpdateChecker
|
||||
import xyz.alexcrea.cuanvil.update.PluginSetDefault
|
||||
import xyz.alexcrea.cuanvil.update.UpdateHandler
|
||||
import xyz.alexcrea.cuanvil.util.Metrics
|
||||
import xyz.alexcrea.cuanvil.util.MetricsUtil
|
||||
import java.io.File
|
||||
import java.io.FileReader
|
||||
|
|
@ -118,7 +117,8 @@ open class CustomAnvil : JavaPlugin() {
|
|||
try {
|
||||
legacyCheck()
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error trying to check for legacy system" , e)
|
||||
logger.log(Level.SEVERE, "error trying to check for legacy system", e)
|
||||
MetricsUtil.trackError(e)
|
||||
if(trySafeStart()) return
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,8 @@ open class CustomAnvil : JavaPlugin() {
|
|||
try {
|
||||
prepareCommand()
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error trying to register commands" , e)
|
||||
logger.log(Level.SEVERE, "error trying to register commands", e)
|
||||
MetricsUtil.trackError(e)
|
||||
if(trySafeStart()) return
|
||||
}
|
||||
|
||||
|
|
@ -136,6 +137,7 @@ open class CustomAnvil : JavaPlugin() {
|
|||
throw RuntimeException("Error loading configuration file")
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error occurred loading default configuration", e)
|
||||
MetricsUtil.trackError(e)
|
||||
if(tryDirtyStart()) return
|
||||
}
|
||||
|
||||
|
|
@ -144,6 +146,7 @@ open class CustomAnvil : JavaPlugin() {
|
|||
DependencyManager.loadDependency()
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error loading dependency compatibility", e)
|
||||
MetricsUtil.trackError(e)
|
||||
if(tryDirtyStart()) return
|
||||
}
|
||||
|
||||
|
|
@ -152,6 +155,7 @@ open class CustomAnvil : JavaPlugin() {
|
|||
registerListeners()
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error registering listeners", e)
|
||||
MetricsUtil.trackError(e)
|
||||
if(tryDirtyStart()) return
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +175,8 @@ open class CustomAnvil : JavaPlugin() {
|
|||
try {
|
||||
loadEnchantmentSystem()
|
||||
} catch (e: Exception) {
|
||||
logger.log(Level.SEVERE, "error initializing enchantment ssytem", e)
|
||||
logger.log(Level.SEVERE, "error initializing enchantment system", e)
|
||||
MetricsUtil.trackError(e)
|
||||
tryDirtyStart()
|
||||
}
|
||||
}
|
||||
|
|
@ -198,7 +203,10 @@ open class CustomAnvil : JavaPlugin() {
|
|||
|
||||
ModrinthUpdateChecker(modrinthPluginID, loader, null)
|
||||
.setFeatured(featured)
|
||||
.setOnError { logger.log(Level.WARNING, "error trying to fetch latest update", it) }
|
||||
.setOnError {
|
||||
logger.log(Level.WARNING, "error trying to fetch latest update", it)
|
||||
MetricsUtil.trackError(it)
|
||||
}
|
||||
.checkVersion { latestVer: String? ->
|
||||
CustomAnvil.latestVer = latestVer
|
||||
if(latestVer == null || version.contains(latestVer)) return@checkVersion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue