Skip to content

Commit 842ef61

Browse files
authored
Merge pull request #27 from timperrett/master
Handle the error cases better for blueprints
2 parents f852d1f + 08481fe commit 842ef61

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/github.com/getnelson/nelson/blueprint.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ func CreateBlueprint(req CreateBlueprintRequest, http *gorequest.SuperAgent, cfg
100100
}
101101

102102
if r.StatusCode/100 != 2 {
103+
errs = append(errs, errors.New(string(body[:])))
103104
errs = append(errs, errors.New("Unexpectedly recieved a "+strconv.Itoa(r.StatusCode)+" reponse from the server."))
104105
return result, errs
105106
} else {

src/github.com/getnelson/nelson/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ func main() {
213213
r, e := CreateBlueprint(wire, http, cfg)
214214
pi.Stop()
215215
if e != nil {
216+
PrintTerminalErrors(e)
216217
return cli.NewExitError("Unable to create blueprint.", 1)
217218
} else {
218219
fmt.Println("Successfully created blueprint " + r.Name + "@" + r.Revision + ".")
@@ -252,6 +253,7 @@ func main() {
252253
r, e := InspectBlueprint(bpName, http, cfg)
253254
pi.Stop()
254255
if e != nil {
256+
PrintTerminalErrors(e)
255257
return cli.NewExitError("Unable to create blueprint.", 1)
256258
} else {
257259
fmt.Println(r.Template)

0 commit comments

Comments
 (0)