sdk-go
sdk-go copied to clipboard
HTTP error response details are not being shown
When getting an error response message, the return message is not being shown.
When this is returned in response to a 404 error return cloudevents.NewHTTPResult(http.StatusNotFound, "Failed to find a target for event and tenant header")
it would be expected that "Failed to find a target for event and tenant header" would be shown in the response, but it is not.
response:
- upload completely sent off: 114 out of 114 bytes < HTTP/1.1 404 Not Found < Date: Thu, 19 Nov 2020 16:42:08 GMT < Content-Length: 0 <
- Connection #0 to host localhost left intact
- Closing connection 0
I wonder, where would you write these error message? In the body, replying back with a text/plain
?
I would suggest a published response payload format, with the content payload matching the request format. Here's a JSON response body example: {"message": "error details"}
I recall we vaguely already discussed about that, @n3wscott @antoineco do you remember something about it?
Yes, and still don't understand the current API.
I believe the message should be removed from that function since it's unused, and unlikely to be used if I understood the comments from #514 correctly.