refactor(log): replace panics with log fatal or log panic functions (#1723)

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-11-24 10:38:36 +02:00
committed by GitHub
parent 83f287d1f6
commit 92837c2bcb
22 changed files with 969 additions and 302 deletions
+2 -4
View File
@@ -105,15 +105,13 @@ func (hr *HotReloader) Start() context.Context {
}
// watch for errors
case err := <-hr.watcher.Errors:
log.Error().Err(err).Str("config", hr.filePath).Msg("fsnotfy error while watching config")
panic(err)
log.Panic().Err(err).Str("config", hr.filePath).Msg("fsnotfy error while watching config")
}
}
}()
if err := hr.watcher.Add(hr.filePath); err != nil {
log.Error().Err(err).Str("config", hr.filePath).Msg("error adding config file to FsNotify watcher")
panic(err)
log.Panic().Err(err).Str("config", hr.filePath).Msg("error adding config file to FsNotify watcher")
}
<-done