From 1a446ae3bf689aabc6020cf3838d03d72913a9fd Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Thu, 14 Aug 2025 13:44:52 -0300 Subject: [PATCH] Add some error inspection and logging --- src/groups/calls/commands.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/groups/calls/commands.rs b/src/groups/calls/commands.rs index dda24d2..8d7e4c9 100644 --- a/src/groups/calls/commands.rs +++ b/src/groups/calls/commands.rs @@ -164,6 +164,7 @@ impl Command for SkipCommand { let call = Call::get_by_id(channel.call_id.unwrap(), &ctx.rt.state.db) .await + .inspect_err(|e| log::error!("Failed to get call: {e:?}")) .map_err(|_| CommandError::DatabaseQueryFailed)? .ok_or(CommandError::DatabaseInconsistentState)?; @@ -179,10 +180,16 @@ impl Command for SkipCommand { .create_message(Id::new(other_channel_id)) .content("☎️ The other party hung up the phone.") .await + .inspect_err(|e| { + log::error!("Failed to send message to other party: {e:?}"); + }) .map_err(|_| CommandError::MessageSendingFailed)?; let call = Call::start(&channel, &ctx.rt.state.db) .await + .inspect_err(|e| { + log::error!("Failed to start (skipped) call: {e:?}"); + }) .map_err(|_| CommandError::DatabaseQueryFailed)?; if let Some(call) = call {