Skip to content

Commit

Permalink
Propagate read error correctly in event-dispatcher (#8005)
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr authored Jun 17, 2024
1 parent 43cf75a commit 0eee301
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kncloudevents/event_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func (d *Dispatcher) executeRequest(ctx context.Context, target duckv1.Addressab
var responseMessageBody []byte
if err != nil && err != io.EOF {
responseMessageBody = []byte(fmt.Sprintf("Failed to read response body: %s", err.Error()))
dispatchInfo.ResponseCode = http.StatusInternalServerError
} else {
responseMessageBody = body.Bytes()
dispatchInfo.ResponseBody = responseMessageBody
Expand Down

0 comments on commit 0eee301

Please sign in to comment.