Change error message return structure
This commit is contained in:
parent
9d3f40a513
commit
0a5acaa0d8
|
@ -44,10 +44,11 @@ type TimeoutError struct {
|
|||
}
|
||||
|
||||
func (e *TimeoutError) Error() string {
|
||||
msg := fmt.Sprintf("timeout while waiting for state to become '%s'",
|
||||
strings.Join(e.ExpectedState, ", "))
|
||||
if e.LastError != nil {
|
||||
msg += fmt.Sprintf(". last error: %s", e.LastError)
|
||||
return fmt.Sprintf("timeout while waiting for state to become '%s': %s",
|
||||
strings.Join(e.ExpectedState, ", "), e.LastError)
|
||||
}
|
||||
return msg
|
||||
|
||||
return fmt.Sprintf("timeout while waiting for state to become '%s'",
|
||||
strings.Join(e.ExpectedState, ", "))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue