From 42820dd130273aa4fca31b0e76167155672b54f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Fr=C3=B6ssman?= Date: Sun, 7 Apr 2024 15:19:51 +0200 Subject: [PATCH] slightly better error log message when scanning battles directory fails --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8b0b0ce..531d3b1 100644 --- a/main.go +++ b/main.go @@ -61,7 +61,8 @@ func main() { fsc := scanner.FSScanner{Fsys: rootFsys} battles, err := scanner.GetAllBattles(fsc.GetBattleNames, fsc.GetBattle) if err != nil { - panic(err) + slog.Error("error reading battles from directory", "dir", flags.Dir, "err", err) + os.Exit(1) } for _, b := range battles { if err := db.UpdateBattle(b); err != nil {