propagate errors if we fail processing admin room subcommands

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-27 16:56:57 -04:00 committed by June
parent 48d1a3af3c
commit 1893b45de3
1 changed files with 8 additions and 8 deletions

View File

@ -158,7 +158,7 @@ impl Service {
&conduit_room, &conduit_room,
&state_lock) &state_lock)
.await .await
.unwrap(); .unwrap(); // TODO: can we remove this unwrap?
drop(state_lock); drop(state_lock);
@ -232,13 +232,13 @@ impl Service {
async fn process_admin_command(&self, command: AdminCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> { async fn process_admin_command(&self, command: AdminCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
let reply_message_content = match command { let reply_message_content = match command {
AdminCommand::Appservices(command) => appservice::process(command, body).await.unwrap(), AdminCommand::Appservices(command) => appservice::process(command, body).await?,
AdminCommand::Media(command) => media::process(command, body).await.unwrap(), AdminCommand::Media(command) => media::process(command, body).await?,
AdminCommand::Users(command) => user::process(command, body).await.unwrap(), AdminCommand::Users(command) => user::process(command, body).await?,
AdminCommand::Rooms(command) => room::process(command, body).await.unwrap(), AdminCommand::Rooms(command) => room::process(command, body).await?,
AdminCommand::Federation(command) => federation::process(command, body).await.unwrap(), AdminCommand::Federation(command) => federation::process(command, body).await?,
AdminCommand::Server(command) => server::process(command, body).await.unwrap(), AdminCommand::Server(command) => server::process(command, body).await?,
AdminCommand::Debug(command) => debug::process(command, body).await.unwrap(), AdminCommand::Debug(command) => debug::process(command, body).await?,
}; };
Ok(reply_message_content) Ok(reply_message_content)