mirror of
https://github.com/pgsty/minio.git
synced 2026-03-15 17:17:01 +01:00
convert repeated error checks into single function in logger (#15387)
This commit is contained in:
@@ -18,7 +18,10 @@
|
||||
package logger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
@@ -59,3 +62,8 @@ func ansiRestoreAttributes() {
|
||||
ansiEscape("8")
|
||||
}
|
||||
}
|
||||
|
||||
// logIgnoreError if true,the error will ignore.
|
||||
func logIgnoreError(err error) bool {
|
||||
return err == nil || errors.Is(err, context.Canceled) || errors.Is(err, http.ErrServerClosed) || err.Error() == "disk not found"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user