cosmo
cosmo copied to clipboard
The response is nil in OnOriginResponse method
Hi
This question is about router project.
During testing of the custom module I implemented, I found that if a timeout or exception occurs when calling the subgraph, the OnOriginResponse(response *http.Response, ctx core.RequestContext) method receives a nil response, making it impossible to access response.Request and complete other operations.
For example, in the OnOriginRequest(request *http.Request, ctx core.RequestContext) method, a tracing span is created, and then in the OnOriginResponse(response *http.Response, ctx core.RequestContext) method, based on the execution result, logs need to be recorded and the span needs to be finished. However, since the response is nil, this logic cannot be implemented.
Thanks for your feedbacks and assistance