From 382c521df725e351a283010dfbe30846ec400b39 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Fri, 20 Feb 2015 09:12:02 -0800 Subject: [PATCH] Show returned content when can not parse son --- go/topology/allocate_volume.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/topology/allocate_volume.go b/go/topology/allocate_volume.go index 669177c09..22730211d 100644 --- a/go/topology/allocate_volume.go +++ b/go/topology/allocate_volume.go @@ -3,6 +3,7 @@ package topology import ( "encoding/json" "errors" + "fmt" "net/url" "github.com/chrislusf/weed-fs/go/storage" @@ -25,7 +26,7 @@ func AllocateVolume(dn *DataNode, vid storage.VolumeId, option *VolumeGrowOption } var ret AllocateVolumeResult if err := json.Unmarshal(jsonBlob, &ret); err != nil { - return err + return fmt.Errorf("Invalid JSON result for %s: %s", "/admin/assign_volum", string(jsonBlob)) } if ret.Error != "" { return errors.New(ret.Error)