From 33c14bcc5faa5199b87e353c428539e7e4aeea33 Mon Sep 17 00:00:00 2001 From: simulot Date: Sun, 13 Oct 2024 10:03:07 +0200 Subject: [PATCH] Refactor error handling in main.go --- main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 26a4d4e..338663a 100644 --- a/main.go +++ b/main.go @@ -67,10 +67,9 @@ func runImmichGo(ctx context.Context) error { // let's start err := cmd.ExecuteContext(ctx) - if err != nil { - if app.Log() != nil { - app.Log().Error(err.Error()) - } + if err != nil && app.Log().GetSLog() != nil { + app.Log().Error(err.Error()) } + return err }