feat: handle workspace conflict error

This commit is contained in:
2024-12-02 19:12:26 +00:00
parent 4c34689ceb
commit 5fa55493b7
12 changed files with 74 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/go-connections/nat"
"strconv"
"strings"
)
// ContainerSSHHostPort returns the port on the host that is exposing the internal ssh port of the given container info
@@ -33,3 +34,8 @@ func ContainerHostPort(ctx context.Context, container types.ContainerJSON, port
}
return port
}
// CleanErrorMessage removes unnecessary parts in a docker sdk error message, such as "Error response from daemon:"
func CleanErrorMessage(msg string) string {
return strings.Replace(msg, "Error response from daemon: ", "", 1)
}