1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

log error and ensure we pass through namespace

This commit is contained in:
Asim Aslam
2020-04-23 17:14:30 +01:00
parent 2299559397
commit ec929b3d2f
2 changed files with 4 additions and 4 deletions

View File

@ -3,6 +3,7 @@ package api
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
)
@ -50,9 +51,8 @@ func (r *Response) Into(data interface{}) error {
defer r.res.Body.Close()
decoder := json.NewDecoder(r.res.Body)
err := decoder.Decode(&data)
if err != nil {
return ErrDecode
if err := decoder.Decode(&data); err != nil {
return fmt.Errorf("%v: %v", ErrDecode, err)
}
return r.err