diff --git a/cli/command/task/formatter.go b/cli/command/task/formatter.go index 64509abbea..a7d71115ac 100644 --- a/cli/command/task/formatter.go +++ b/cli/command/task/formatter.go @@ -123,11 +123,11 @@ func (c *taskContext) CurrentState() string { func (c *taskContext) Error() string { // Trim and quote the error message. taskErr := c.task.Status.Err - if c.trunc && len(taskErr) > maxErrLength { - taskErr = fmt.Sprintf("%s…", taskErr[:maxErrLength-1]) + if c.trunc { + taskErr = formatter.Ellipsis(taskErr, maxErrLength) } if len(taskErr) > 0 { - taskErr = fmt.Sprintf("\"%s\"", taskErr) + taskErr = fmt.Sprintf(`"%s"`, taskErr) } return taskErr }