Permalink
Browse files

More detailed errors on view failures.

  • Loading branch information...
1 parent 25bb374 commit 49d8b880a11e720c8973a97649cd2eedefafd2b5 @dustin dustin committed Nov 2, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 client.go
View
@@ -474,12 +474,15 @@ func (b *Bucket) ViewCustom(ddoc, name string, params map[string]interface{},
res, err := HttpClient.Get(u.String())
if err != nil {
- return err
+ return fmt.Errorf("Error starting view req at %v: %v", u, err)
}
defer res.Body.Close()
if res.StatusCode != 200 {
- return errors.New(res.Status)
+ bod := make([]byte, 512)
+ l, _ := res.Body.Read(bod)
+ return fmt.Errorf("Error executing view req at %v: %v - %s",
+ u, res.Status, bod[:l])
}
d := json.NewDecoder(res.Body)

0 comments on commit 49d8b88

Please sign in to comment.