PTAL. The motivation here is to improve the errors we see in DevTools which have an empty `detail` field:
```
{detail: '', error: 'Request failed', netError: 0, netErrorName: 'net::OK', statusCode: 400}
```
Which makes it nearly impossible to debug.
I am not familiar with the workings of this code and I used AI to help me put the fix together. It makes sense to me but please push back and tell me if we should be approaching this differently.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTanotherL - the test failures highlighted that we can't access the headers on the response during the streaming as it might not be complete.
This is not my area of expertise so feedback welcome on better approaches if there is a more conventional way to deal with this.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
size_t bytes_to_append = std::min(Consider adding `#include <algorithm>` at the top of the file since `std::min` is used here. While it likely compiles due to transitive includes from other headers, it's generally a good practice to include it explicitly.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Consider adding `#include <algorithm>` at the top of the file since `std::min` is used here. While it likely compiles due to transitive includes from other headers, it's generally a good practice to include it explicitly.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
re-stamping with a nit
request.consumer->GetWeakPtr()));nit: I imagine we don't really need a week ptr here, as the request would be retaining consumer until at least the response has started :-)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
Thank you for the feedback - PTanotherL 😊
nit: I imagine we don't really need a week ptr here, as the request would be retaining consumer until at least the response has started :-)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
DevTools: Buffer error response body in DevToolsStreamConsumer
When a streaming HTTP request dispatched via DispatchHttpRequestClient
fails (e.g., with a 400 error), the error response body was not being
captured by DevToolsStreamConsumer. This led to an empty "detail" field
in the error object logged on the DevTools frontend.
This CL updates DevToolsStreamConsumer to accumulate response chunks
when the status code represents an HTTP error. Upon completion, this
accumulated body is assigned to `result->response_body`. This makes
error payloads available under the "detail" field in the frontend,
matching the existing behavior of non-streamed requests.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |