Skip to content

Commit

Permalink
fix v3 error return
Browse files Browse the repository at this point in the history
Signed-off-by: smtmfft <[email protected]>
  • Loading branch information
smtmfft committed Sep 20, 2024
1 parent 728cb3a commit 16e4abc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions host/src/server/api/v3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ impl From<Proof> for Status {

impl From<TaskStatus> for Status {
fn from(status: TaskStatus) -> Self {
Self::Ok {
data: ProofResponse::Status { status },
match status {
TaskStatus::Success | TaskStatus::WorkInProgress | TaskStatus::Registered => Self::Ok {
data: ProofResponse::Status { status },
},
_ => Self::Error {
error: "task_failed".to_string(),
message: format!("Task failed with status: {status:?}"),
},
}
}
}
Expand Down

0 comments on commit 16e4abc

Please sign in to comment.