func newDecodeRequestError(req *http.Request, bodyData []byte, err error) *DecodeRequestError {
	if bodyData == nil {
		bodyData = readBodyForError(req.Body)
	}
	req1 := *req
	req1.Body = ioutil.NopCloser(bytes.NewReader(bodyData))

	return &DecodeRequestError{
		Request:     &req1,
		DecodeError: errgo.Mask(err, errgo.Any),
	}
}
// newDecodeRequestError returns a new DecodeRequestError that
// uses the given error for its message. The Request field
// holds a copy of req. If bodyData is non-nil, it
// will be used as the data in the Request.Body field;
// otherwise body data will be read from req.Body.
newDecodeRequestError returns a new DecodeRequestError that
uses the given error for its message. The Request field
holds a copy of req. If bodyData is non-nil, it
will be used as the data in the Request.Body field;
otherwise body data will be read from req.Body.
// newDecodeRequestError returns a new DecodeRequestError that // uses the given error for its message . The Request field // holds a copy of req . If bodyData is non - nil it // will be used as the data in the Request . Body field ; // otherwise body data will be read from req . Body .
func newDecodeRequestError(req *http.Request, bodyData []byte, err error) *DecodeRequestError {
	if bodyData == nil {
		bodyData = readBodyForError(req.Body)
	}
	req1 := *req
	req1.Body = ioutil.NopCloser(bytes.NewReader(bodyData))
	return &DecodeRequestError{
		Request:     &req1,
		DecodeError: errgo.Mask(err, errgo.Any),
	}
}
func newDecodeRequestError ( req * http . Request , bodyData [ ] byte , err error ) * DecodeRequestError { if bodyData == nil { bodyData = readBodyForError ( req . Body ) } req1 := * req req1 . Body = ioutil . NopCloser ( bytes . NewReader ( bodyData ) ) return & DecodeRequestError { Request : & req1 , DecodeError : errgo . Mask ( err , errgo . Any ) , } }
newDecodeRequestError returns a new DecodeRequestError that
uses the given error for its message.
newDecodeRequestError returns a new DecodeRequestError that uses the given error for its message .