Commit 217bfed
[ DDS ] Add middleware that converts exceptions thrown by handlers into error responses
Handler functions may return a Future<Response> that completes with an error. If that happens, then the top level error handling in the Shelf server will try to log the error to stderr.
But this will fail because DDS closes its stderr at startup. So Shelf will not write any response to the client, and the client will time out.
This PR adds a middleware to the DDS pipeline that receives errors thrown by the pipeline's handlers and returns a failure response.
Change-Id: I31beaf6abb0cbb42137c6b03f6081809de5d7119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405681
Commit-Queue: Ben Konyi <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>1 parent 8968e0e commit 217bfed
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
| |||
0 commit comments