Error not handled

This commit is contained in:
skiffer-git 2024-03-08 15:56:54 +08:00
parent 210936411d
commit 37947623e3

View File

@ -102,6 +102,7 @@ func main() {
if !check.flag { if !check.flag {
err = check.function(check.config) err = check.function(check.config)
if err != nil { if err != nil {
if check.name == "Minio" {
if errors.Is(err, errMinioNotEnabled) { if errors.Is(err, errMinioNotEnabled) {
fmt.Println(err.Error()) fmt.Println(err.Error())
checks[index].flag = true checks[index].flag = true
@ -110,6 +111,8 @@ func main() {
fmt.Fprintf(os.Stderr, err.Error()) fmt.Fprintf(os.Stderr, err.Error())
checks[index].flag = true checks[index].flag = true
} }
}
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error())) component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
if strings.Contains(errs.Unwrap(err).Error(), "connection refused") || if strings.Contains(errs.Unwrap(err).Error(), "connection refused") ||
strings.Contains(errs.Unwrap(err).Error(), "timeout") || strings.Contains(errs.Unwrap(err).Error(), "timeout") ||