From 364413d21aa83a8427c317bbb3ad9733a1e2b97b Mon Sep 17 00:00:00 2001 From: David Pacheco Date: Wed, 13 Nov 2024 10:28:12 -0800 Subject: [PATCH] fixes --- bin/mock-server/src/lib/lib.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/mock-server/src/lib/lib.rs b/bin/mock-server/src/lib/lib.rs index 9d6568a8..14aa76fe 100644 --- a/bin/mock-server/src/lib/lib.rs +++ b/bin/mock-server/src/lib/lib.rs @@ -14,7 +14,7 @@ use dropshot::{ TypedBody, WebsocketConnection, }; use futures::SinkExt; -use slog::{error, info, Logger}; +use slog::{error, info, o, Logger}; use thiserror::Error; use tokio::sync::{watch, Mutex}; use tokio_tungstenite::tungstenite::protocol::{Role, WebSocketConfig}; @@ -678,7 +678,8 @@ pub type Config = dropshot::ConfigDropshot; /// the dropshot server itself pub type Server = dropshot::HttpServer>; /// errors returned from attempting to start a dropshot server -pub type ServerStartError = dropshot::GenericError; +// Dropshot should expose this, but it's going to be removed anyway. +pub type ServerStartError = Box; /// Starts a Propolis mock server pub async fn start( @@ -688,6 +689,11 @@ pub async fn start( let propolis_log = log.new(o!("component" => "propolis-server-mock")); let dropshot_log = log.new(o!("component" => "dropshot")); let private = Arc::new(Context::new(propolis_log)); - dropshot::HttpServerStarter::new(&config, api(), private, &dropshot_log)? - .start() + let starter = dropshot::HttpServerStarter::new( + &config, + api(), + private, + &dropshot_log, + )?; + Ok(starter.start()) }