max / makenotwork
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
- Claude-Session
- https://claude.ai/code/session_01P8ostB2UmZJGj5WjSHRSot
1 file changed,
+8 insertions,
-9 deletions
| @@ -915,11 +915,11 @@ | |||
| 915 | 915 | let carried = Carried::of(&mut parts).await; | |
| 916 | 916 | ||
| 917 | 917 | // On a blocking thread. See `served` for why. | |
| 918 | - | let answered = match tokio::task::spawn_blocking(move || answer(&viewer, &carried)) | |
| 919 | - | .await | |
| 920 | - | { | |
| 921 | - | Ok(answered) => answered, | |
| 922 | - | Err(_) => return axum::http::StatusCode::INTERNAL_SERVER_ERROR.into_response(), | |
| 918 | + | let Ok(answered) = | |
| 919 | + | tokio::task::spawn_blocking(move || answer(&viewer, &carried)).await | |
| 920 | + | else { | |
| 921 | + | // A panic in the answer. Reported as ours, because it is. | |
| 922 | + | return axum::http::StatusCode::INTERNAL_SERVER_ERROR.into_response(); | |
| 923 | 923 | }; | |
| 924 | 924 | ||
| 925 | 925 | match answered { | |
| @@ -1086,16 +1086,15 @@ | |||
| 1086 | 1086 | // ours rather than the adapter's, so it is the one place that | |
| 1087 | 1087 | // has to say so. | |
| 1088 | 1088 | let held = (viewer, carried); | |
| 1089 | - | let (answered, held) = match tokio::task::spawn_blocking(move || { | |
| 1089 | + | let Ok((answered, held)) = tokio::task::spawn_blocking(move || { | |
| 1090 | 1090 | let outcome = answer(&held.0, &held.1); | |
| 1091 | 1091 | (outcome, held) | |
| 1092 | 1092 | }) | |
| 1093 | 1093 | .await | |
| 1094 | - | { | |
| 1095 | - | Ok(answered) => answered, | |
| 1094 | + | else { | |
| 1096 | 1095 | // A panic in the answer. Reported as ours, because it is, | |
| 1097 | 1096 | // and the same way the adapter reports one. | |
| 1098 | - | Err(_) => return axum::http::StatusCode::INTERNAL_SERVER_ERROR.into_response(), | |
| 1097 | + | return axum::http::StatusCode::INTERNAL_SERVER_ERROR.into_response(); | |
| 1099 | 1098 | }; | |
| 1100 | 1099 | let viewer = held.0; | |
| 1101 | 1100 |