Browse Source

Don't panic in endpoints

Does not tackle fixing previously already existing endpoints.
upload-correct-windows-binary
Daniel Karzel 3 years ago
parent
commit
a43312de2d
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 5
      daemon/src/routes_taker.rs

5
daemon/src/routes_taker.rs

@ -120,13 +120,14 @@ pub async fn post_cfd_action(
) -> Result<status::Accepted<()>, status::BadRequest<String>> { ) -> Result<status::Accepted<()>, status::BadRequest<String>> {
match action { match action {
CfdAction::Accept | CfdAction::Reject => { CfdAction::Accept | CfdAction::Reject => {
unreachable!("The taker does not accept and reject"); return Err(status::BadRequest(None));
} }
CfdAction::Commit => { CfdAction::Commit => {
cfd_actor_address cfd_actor_address
.do_send_async(taker_cfd::Commit { order_id: id }) .do_send_async(taker_cfd::Commit { order_id: id })
.await .await
.expect("actor to always be available"); .map_err(|e| status::BadRequest(Some(e.to_string())))?;
} }
} }

Loading…
Cancel
Save