mirror of https://github.com/perkeep/perkeep.git
client: actually print error from server when upload fails
Change-Id: I98236bc4e6680e0a3d89f2a1a1c47b77ef90e0a0
This commit is contained in:
parent
acf2eeb2d4
commit
f2951298b1
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue