Skip to content

Commit

Permalink
delete, start: remove newline from errors
Browse files Browse the repository at this point in the history
Error messages should not usually contain newlines.

Testing shows that the error runc delete prints is the same before and
after this commit:

	[kir@kir-rhat runc-tst]$ sudo ../runc/runc delete xx3
	ERRO[0000] cannot delete container xx3 that is not stopped: running
	[kir@kir-rhat runc-tst]$

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Sep 14, 2021
1 parent bcadc5b commit 1545ea6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion delete.go
Expand Up @@ -79,7 +79,7 @@ status of "ubuntu01" as "stopped" the following will delete resources held for
if force {
return killContainer(container)
}
return fmt.Errorf("cannot delete container %s that is not stopped: %s\n", id, s)
return fmt.Errorf("cannot delete container %s that is not stopped: %s", id, s)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion start.go
Expand Up @@ -48,7 +48,7 @@ your host.`,
case libcontainer.Running:
return errors.New("cannot start an already running container")
default:
return fmt.Errorf("cannot start a container in the %s state\n", status)
return fmt.Errorf("cannot start a container in the %s state", status)
}
},
}

0 comments on commit 1545ea6

Please sign in to comment.