Replace http_server unwrap with 500 error

This commit is contained in:
Paul Hauner
2019-05-27 17:09:16 +10:00
parent 3a65f84b12
commit ed4d7aa44a
3 changed files with 16 additions and 5 deletions

View File

@@ -108,3 +108,11 @@ pub fn start_service<T: BeaconChainTypes + 'static>(
shutdown_trigger
}
/// Helper function for mapping a failure to read state to a 500 server error.
fn map_persistent_err_to_500(e: persistent::PersistentError) -> iron::error::IronError {
iron::error::IronError {
error: Box::new(e),
response: iron::Response::with(iron::status::Status::InternalServerError),
}
}