From f2951298b1d3ef5e7af57da0d6ee9a9a066cef59 Mon Sep 17 00:00:00 2001 From: mpl Date: Tue, 5 Aug 2014 20:38:59 +0200 Subject: [PATCH] client: actually print error from server when upload fails Change-Id: I98236bc4e6680e0a3d89f2a1a1c47b77ef90e0a0 --- pkg/blobserver/protocol/protocol.go | 2 +- pkg/client/upload.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/blobserver/protocol/protocol.go b/pkg/blobserver/protocol/protocol.go index 2769ef2f1..59889b70a 100644 --- a/pkg/blobserver/protocol/protocol.go +++ b/pkg/blobserver/protocol/protocol.go @@ -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) { diff --git a/pkg/client/upload.go b/pkg/client/upload.go index ccfe902c6..6fd9d53bb 100644 --- a/pkg/client/upload.go +++ b/pkg/client/upload.go @@ -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)