client: actually print error from server when upload fails

Change-Id: I98236bc4e6680e0a3d89f2a1a1c47b77ef90e0a0
This commit is contained in:
mpl 2014-08-05 20:38:59 +02:00
parent acf2eeb2d4
commit f2951298b1
2 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,7 @@ func (p *StatResponse) MarshalJSON() ([]byte, error) {
// See doc/protocol/blob-upload-protocol.txt.
type UploadResponse struct {
Received []*RefAndSize `json:"received"`
ErrorText string `json:"errortext,omitempty"`
ErrorText string `json:"errorText,omitempty"`
}
func (p *UploadResponse) MarshalJSON() ([]byte, error) {

View File

@ -488,6 +488,7 @@ func (c *Client) Upload(h *UploadHandle) (*PutResult, error) {
}
}
// TODO(mpl): use struct type instead of map for res.
ures, err := c.responseJSONMap("upload", resp)
if err != nil {
return errorf("json parse from upload error: %v", err)