Repository navigation
Commit 921dc3e
authored
Log route handler errors and answer them with a 500 page (#3621)
`run!` hands each request to `HTTP.streamhandler`, so the `try` around it also covers Pluto's route handlers, and `is_disconnection_exception` treats any `IOError` or `SystemError` as the client hanging up. An exception from a handler, such as `POST /notebookupload` failing to write the uploaded file, was dropped without being logged: HTTP.jl 2 answered `200` with an empty body, HTTP.jl 1 a bare `500`.
`internal_error_middleware` catches what the handlers throw, logs it, and answers with Pluto's `500` error page, which the frontend shows when an upload fails. It sits inside `default_headers_middleware`, so the error page gets the same headers as any other response, and the outer `try` only sees failures to read the request or write the response.1 parent 38496f0 commit 921dc3e
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
149 | 164 | | |
150 | 165 | | |
151 | 166 | | |
| |||
173 | 188 | | |
174 | 189 | | |
175 | 190 | | |
176 | | - | |
| 191 | + | |
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
111 | 120 | | |
112 | 121 | | |
113 | 122 | | |
| |||
0 commit comments