mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Improve disk formatting stage for large disk sets (#8690)
This commit is contained in:
committed by
kannappanr
parent
725172e13b
commit
f68a7005c0
@@ -39,7 +39,10 @@ type Err struct {
|
||||
// Return the error message
|
||||
func (u Err) Error() string {
|
||||
if u.detail == "" {
|
||||
return u.msg
|
||||
if u.msg != "" {
|
||||
return u.msg
|
||||
}
|
||||
return "<nil>"
|
||||
}
|
||||
return u.detail
|
||||
}
|
||||
@@ -77,6 +80,10 @@ func newErrFn(msg, action, hint string) ErrFn {
|
||||
// ErrorToErr inspects the passed error and transforms it
|
||||
// to the appropriate UI error.
|
||||
func ErrorToErr(err error) Err {
|
||||
if err == nil {
|
||||
return Err{}
|
||||
}
|
||||
|
||||
// If this is already a Err, do nothing
|
||||
if e, ok := err.(Err); ok {
|
||||
return e
|
||||
@@ -95,7 +102,6 @@ func ErrorToErr(err error) Err {
|
||||
// Failed to identify what type of error this, return a simple UI error
|
||||
return Err{msg: err.Error()}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FmtError converts a fatal error message to a more clear error
|
||||
|
||||
Reference in New Issue
Block a user