diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-02-20 09:12:02 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-02-20 09:12:02 -0800 |
| commit | 382c521df725e351a283010dfbe30846ec400b39 (patch) | |
| tree | 39be0695b785f7e63e2094056ae8dfb9f9d4bbf6 | |
| parent | 226df38c957f8d564e348f5a052c40d34b7bea21 (diff) | |
| download | seaweedfs-382c521df725e351a283010dfbe30846ec400b39.tar.xz seaweedfs-382c521df725e351a283010dfbe30846ec400b39.zip | |
Show returned content when can not parse son
| -rw-r--r-- | go/topology/allocate_volume.go | 3 |
1 files changed, 2 insertions, 1 deletions
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) |
