diff --git a/helper/resource/error.go b/helper/resource/error.go index d1f6076f9..7762a2d25 100644 --- a/helper/resource/error.go +++ b/helper/resource/error.go @@ -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, ", ")) }