improve exception handling

This commit is contained in:
2025-10-06 18:33:36 +02:00
parent 1b450758d3
commit 80c9d458b4
3 changed files with 9 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package com.minres.tgc.hammer
import ch.qos.logback.classic.Level
import com.minres.tgc.hammer.cli.{HammerConf, MySubcommand}
import com.minres.tgc.hammer.util.AssertException
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
@@ -36,8 +37,11 @@ object Main {
try {
tasks.foreach(_.run())
} catch {
case e: Exception =>
case e: AssertException =>
logger.error(s"Error during task execution, see above!")
case e: Exception =>
logger.error(s"General exception ${e.getMessage}")
e.printStackTrace()
}
case _ =>
logger.error(s"Found no subcommand, see help below")