Skip to content

Commit

Permalink
format error response to string
Browse files Browse the repository at this point in the history
  • Loading branch information
klauern committed Sep 18, 2015
1 parent 4daa96a commit ea51c58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/cobra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import "testing"

func TestApplicationsFlags(t *testing.T) {
// TODO write tests for all application flags
}
}
3 changes: 2 additions & 1 deletion wls/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ func request(url string, e *AdminServer) (*http.Response, error) {
if resp.StatusCode >= 200 && resp.StatusCode < 300 {
return resp, nil
}
return nil, fmt.Errorf("Invalid Response Code: %v\nResponse: %v", resp.StatusCode, resp.Body)
body, _ := ioutil.ReadAll(resp.Body)
return nil, fmt.Errorf("Invalid Response Code: %v\nResponse: \n%v", resp.StatusCode, string(body))
}

// Take the raw response from the server and attempt to unmarshal it into the Wrapper type.
Expand Down
1 change: 1 addition & 0 deletions wls/datasources.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package wls

import (
"bytes"
"encoding/json"
"fmt"
)
Expand Down

0 comments on commit ea51c58

Please sign in to comment.