fix: correct Errorf/Fatalf argument handling

- Fix incorrect argument passing to log.Errorf and log.Fatalf functions
- Remove debugging comments, temporary tests, and print statements
- Address linter warnings related to error logging
This commit is contained in:
iyz
2025-02-20 13:34:34 -05:00
committed by Manuel Rüger
parent 024259e480
commit 7f5dfae904
6 changed files with 7 additions and 111 deletions

View File

@@ -17,19 +17,18 @@ func NewErrorHandler(continueOnError bool) *FatalErrorHandler {
}
func (h *FatalErrorHandler) Handle(err error, format string, args ...interface{}) {
errorMesage := fmt.Sprintf(format, args...)
if err == nil {
if h.ContinueOnError {
log.Error(errorMesage)
log.Error(fmt.Sprintf(format, args...))
return
}
log.Fatal(errorMesage)
log.Fatal(fmt.Sprintf(format, args...))
}
if h.ContinueOnError {
log.Errorf(err, errorMesage)
return
if h.ContinueOnError {
log.Errorf(err, format, args...)
return
}
log.Fatalf(err, errorMesage)
log.Fatalf(err, format, args...)
}