mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user