Skip to content

Commit b331d7e

Browse files
committed
don't try to deserialize invalid bson
1 parent 258259c commit b331d7e

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

Cargo.lock

+56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/backend/src/main.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ async fn run(Query(body): Query<RunPayload>) -> Result<Html<String>, ApiError> {
6666
.await
6767
.map_err(Error::from)?;
6868

69-
debug!(status = ?res.status(), "got response from compiler");
69+
let status = res.status();
70+
debug!(status = ?status, "got response from compiler");
71+
72+
if !status.is_success() {
73+
return Err(ApiError::Unknown(
74+
anyhow!("Compiler service returned an error: {}", res.text().await.unwrap())
75+
))
76+
}
7077

7178
let run_response: common::Response = {
7279
let bytes = res.bytes().await.map_err(|e| {

0 commit comments

Comments
 (0)