Skip to content

Commit 09bc773

Browse files
feat(*): update sdk to use new error system. (#92)
1 parent f38a8e4 commit 09bc773

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/auth.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"errors"
55
"fmt"
66
"os"
7-
"reflect"
87
"strings"
98
"syscall"
109

@@ -228,10 +227,8 @@ func Cancel(username string, password string, yes bool) error {
228227
}
229228

230229
err = auth.Delete(c, username)
231-
cleanup := fmt.Errorf("\n%s %s\n\n", "409", "Conflict")
232-
if reflect.DeepEqual(err, cleanup) {
233-
fmt.Printf("%s still has applications associated with it. Transfer ownership or delete them first\n", username)
234-
return nil
230+
if err == deis.ErrConflict {
231+
return fmt.Errorf("%s still has applications associated with it. Transfer ownership or delete them first", username)
235232
} else if checkAPICompatibility(c, err) != nil {
236233
return err
237234
}

cmd/ps.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/deis/controller-sdk-go"
1011
"github.com/deis/controller-sdk-go/api"
1112
"github.com/deis/controller-sdk-go/ps"
1213
)
@@ -108,7 +109,9 @@ func PsRestart(appID, target string) error {
108109
processes, err := ps.Restart(c, appID, psType, psName)
109110
quit <- true
110111
<-quit
111-
if checkAPICompatibility(c, err) != nil {
112+
if err == deis.ErrPodNotFound {
113+
return fmt.Errorf("Could not find proccess type %s in app %s", psType, appID)
114+
} else if checkAPICompatibility(c, err) != nil {
112115
return err
113116
}
114117

glide.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)