From e510e1cb157bec78ffb5bccdabb4b33e7d507d3d Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 24 Apr 2024 01:52:06 +0100 Subject: Log errors occuring during action::run --- src/actions.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/actions.rs') diff --git a/src/actions.rs b/src/actions.rs index 0daec15..648966c 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -3,7 +3,7 @@ use std::fmt; use anyhow::Result; use async_scoped::TokioScope; use async_trait::async_trait; -use log::{debug, info, warn}; +use log::{debug, error, info, warn}; use serde::Deserialize; use crate::message::MessageConfig; @@ -139,7 +139,17 @@ pub async fn run_actions( .unwrap_or("txid".to_string()), action.name() ); - action.run(params_ref); + if let Err(e) = action.run(params_ref).await { + error!( + "[{}][{}][{}] could not run action: {}", + params_ref.map(|p| p.wallet()).unwrap_or("wallet"), + params_ref + .map(|p| p.txid_short()) + .unwrap_or("txid".to_string()), + action.name(), + e + ); + } }); } }); -- cgit v1.2.3-70-g09d2