add traces to unmarshall errors
This commit is contained in:
parent
a939529d19
commit
d291c063ec
4 changed files with 7 additions and 7 deletions
|
@ -141,9 +141,9 @@ func loadConfig(path string) (Config, error) {
|
|||
if os.IsNotExist(err) {
|
||||
return c, errors.Err("config file not found")
|
||||
}
|
||||
return c, err
|
||||
return c, errors.Err(err)
|
||||
}
|
||||
|
||||
err = json.Unmarshal(raw, &c)
|
||||
return c, err
|
||||
return c, errors.Err(err)
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ func (s *Server) handleAvailabilityRequest(data []byte) ([]byte, error) {
|
|||
var request availabilityRequest
|
||||
err := json.Unmarshal(data, &request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Err(err)
|
||||
}
|
||||
|
||||
availableBlobs := []string{}
|
||||
|
@ -220,7 +220,7 @@ func (s *Server) handleCompositeRequest(data []byte) ([]byte, error) {
|
|||
var request compositeRequest
|
||||
err := json.Unmarshal(data, &request)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Err(err)
|
||||
}
|
||||
|
||||
response := compositeResponse{
|
||||
|
|
|
@ -51,7 +51,7 @@ func (d *DBBackedStore) PutSD(hash string, blob stream.Blob) error {
|
|||
var blobContents db.SdBlob
|
||||
err := json.Unmarshal(blob, &blobContents)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Err(err)
|
||||
}
|
||||
if blobContents.StreamHash == "" {
|
||||
return errors.Err("sd blob is missing stream hash")
|
||||
|
|
|
@ -173,8 +173,8 @@ func (n *Node) listen() {
|
|||
}
|
||||
|
||||
if err != nil {
|
||||
n.err(err)
|
||||
r.err = errors.Err(err)
|
||||
n.err(r.err)
|
||||
} else if len(msg.Error.Message) > 0 {
|
||||
r.err = errors.Base("%d: %s", msg.Error.Code, msg.Error.Message)
|
||||
} else {
|
||||
|
@ -258,5 +258,5 @@ func (n *Node) request(method string, params []string, v interface{}) error {
|
|||
return r.err
|
||||
}
|
||||
|
||||
return json.Unmarshal(r.data, v)
|
||||
return errors.Err(json.Unmarshal(r.data, v))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue