diff --git a/daemon/src/routes_taker.rs b/daemon/src/routes_taker.rs index d26dd8f..132dfd8 100644 --- a/daemon/src/routes_taker.rs +++ b/daemon/src/routes_taker.rs @@ -120,13 +120,14 @@ pub async fn post_cfd_action( ) -> Result, status::BadRequest> { match action { CfdAction::Accept | CfdAction::Reject => { - unreachable!("The taker does not accept and reject"); + return Err(status::BadRequest(None)); } + CfdAction::Commit => { cfd_actor_address .do_send_async(taker_cfd::Commit { order_id: id }) .await - .expect("actor to always be available"); + .map_err(|e| status::BadRequest(Some(e.to_string())))?; } }