We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0408af1 commit 1f8e3ebCopy full SHA for 1f8e3eb
internal/container/stop.go
@@ -3,8 +3,8 @@ package container
3
import (
4
"context"
5
"fmt"
6
- "strings"
7
+ "github.com/docker/docker/errdefs"
8
"github.com/localstack/lstk/internal/config"
9
"github.com/localstack/lstk/internal/runtime"
10
)
@@ -33,11 +33,8 @@ type StopError struct {
33
}
34
35
func (e *StopError) Error() string {
36
- msg := e.Err.Error()
37
-
38
- if strings.Contains(msg, "No such container") || strings.Contains(msg, "not found") {
+ if errdefs.IsNotFound(e.Err) {
39
return fmt.Sprintf("%s is not running", e.Name)
40
41
42
- return fmt.Sprintf("Failed to stop %s\n%s", e.Name, msg)
+ return fmt.Sprintf("Failed to stop %s\n%s", e.Name, e.Err.Error())
43
0 commit comments