mirror of
https://github.com/kovetskiy/mark.git
synced 2026-04-25 08:42:37 +00:00
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:
@@ -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...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user