summaryrefslogtreecommitdiff
path: root/pkg/worker_handler/response.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-03 19:43:39 +0300
committerValery Piashchynski <[email protected]>2021-06-03 19:43:39 +0300
commiteb04e1fb4e478ac7d695107d542aa48e36a7c32a (patch)
treef6f7a571c264b9cdace36ae1e0886e3eeda06ffc /pkg/worker_handler/response.go
parent3b06949c7e9a1fc5b2aec7529a97320a6f398535 (diff)
parentc3e57fd82d59be19b2c41479e9019c60a0afc28f (diff)
Merge remote-tracking branch 'origin/master' into bug/fcgi_leads_to_npe
Diffstat (limited to 'pkg/worker_handler/response.go')
-rw-r--r--pkg/worker_handler/response.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/worker_handler/response.go b/pkg/worker_handler/response.go
index 1763d304..cbf22794 100644
--- a/pkg/worker_handler/response.go
+++ b/pkg/worker_handler/response.go
@@ -4,8 +4,8 @@ import (
"io"
"net/http"
"strings"
- "sync"
+ "github.com/spiral/errors"
"github.com/spiral/roadrunner/v2/pkg/payload"
)
@@ -19,14 +19,14 @@ type Response struct {
// associated Body payload.
Body interface{}
- sync.Mutex
}
// NewResponse creates new response based on given pool payload.
func NewResponse(p payload.Payload) (*Response, error) {
+ const op = errors.Op("http_response")
r := &Response{Body: p.Body}
if err := json.Unmarshal(p.Context, r); err != nil {
- return nil, err
+ return nil, errors.E(op, errors.Decode, err)
}
return r, nil