error handling

This commit is contained in:
Xiang Li
2013-07-12 08:41:28 -07:00
parent c135c1e299
commit a131632d3d
5 changed files with 156 additions and 49 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"encoding/json"
//"errors"
"github.com/coreos/etcd/store"
"github.com/coreos/go-raft"
"time"
@ -60,8 +61,7 @@ func (c *GetCommand) CommandName() string {
// Get the value of key
func (c *GetCommand) Apply(server *raft.Server) (interface{}, error) {
res := etcdStore.Get(c.Key)
return json.Marshal(res)
return etcdStore.Get(c.Key)
}
// List command