Skip to content

Commit

Permalink
Merge pull request #64 from mwitkow-io/bugfix/stream-chunk-always-error
Browse files Browse the repository at this point in the history
Fix `error` field always in chunk response
  • Loading branch information
yugui committed Oct 22, 2015
2 parents cfb99a7 + a85604c commit b2a7448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

type responseStreamChunk struct {
Result proto.Message `json:"result,omitempty"`
Error responseStreamError `json:"error,omitempty"`
Error *responseStreamError `json:"error,omitempty"`
}

type responseStreamError struct {
Expand Down Expand Up @@ -103,7 +103,7 @@ func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, re
func handleForwardResponseStreamError(w http.ResponseWriter, err error) {
grpcCode := grpc.Code(err)
httpCode := HTTPStatusFromCode(grpcCode)
resp := responseStreamChunk{Error: responseStreamError{GrpcCode: int(grpcCode),
resp := responseStreamChunk{Error: &responseStreamError{GrpcCode: int(grpcCode),
HTTPCode: httpCode,
Message: err.Error(),
HTTPStatus: http.StatusText(httpCode)}}
Expand Down

0 comments on commit b2a7448

Please sign in to comment.