Proper exception logging in RecipeLoader statements

This commit is contained in:
bdew committed 2014-04-23 13:37:09 +03:00
1 parent 7acca5475f
commit 522ac5b57b
2 files changed
+4 -4

No files matched your search

+2
View File
@@ -21,6 +21,8 @@ object BdLib {
def logInfo(msg: String, args: Any*) = log.info(msg.format(args: _*))
def logWarn(msg: String, args: Any*) = log.warn(msg.format(args: _*))
def logError(msg: String, args: Any*) = log.error(msg.format(args: _*))
def logWarnException(msg: String, t: Throwable, args: Any*) = log.warn(msg.format(args: _*), t)
def logErrorException(msg: String, t: Throwable, args: Any*) = log.error(msg.format(args: _*), t)
@EventHandler
def preInit(ev: FMLPreInitializationEvent) {
+2 -4
View File
@@ -332,8 +332,7 @@ class RecipeLoader {
case e: StatementError =>
BdLib.logError("Error while processing %s: %s", s, e.getMessage)
case e: Throwable =>
BdLib.logError("Error while processing %s: %s", s, e)
e.printStackTrace()
BdLib.logErrorException("Error while processing %s", e, s)
}
}
}
@@ -350,8 +349,7 @@ class RecipeLoader {
case e: StatementError =>
BdLib.logError("Error while processing %s: %s", s, e.getMessage)
case e: Throwable =>
BdLib.logError("Error while processing %s: %s", s, e)
e.printStackTrace()
BdLib.logErrorException("Error while processing %s", e, s)
}
}
}