Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit 8d56f0c

Browse files
authored
Merge pull request #2 from portainer/feat/CE-208/expose-binary-na-error
feat(errors): expose binary not found error
2 parents 03b2b09 + a8978ff commit 8d56f0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wrapper.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import (
66
"os/exec"
77
)
88

9+
var (
10+
// ErrBinaryNotFound is returned when docker-compose binary is not found
11+
ErrBinaryNotFound = errors.New("docker-compose binary not found")
12+
)
13+
914
// ComposeWrapper provide a type for managing docker compose commands
1015
type ComposeWrapper struct {
1116
binaryPath string
@@ -14,7 +19,7 @@ type ComposeWrapper struct {
1419
// NewComposeWrapper initializes a new ComposeWrapper service with local docker-compose binary.
1520
func NewComposeWrapper(binaryPath string) (*ComposeWrapper, error) {
1621
if !IsBinaryPresent(programPath(binaryPath, "docker-compose")) {
17-
return nil, errors.New("docker-compose binary not found")
22+
return nil, ErrBinaryNotFound
1823
}
1924

2025
return &ComposeWrapper{binaryPath: binaryPath}, nil

0 commit comments

Comments
 (0)