Skip to content

Commit

Permalink
Enhance error logging for better debugging
Browse files Browse the repository at this point in the history
Handling database update errors explicitly
  • Loading branch information
grunch committed Jan 13, 2025
1 parent 821df79 commit 2fd7a66
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/fiat_sent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub async fn fiat_sent_action(
let mut order_updated = match update_order_event(my_keys, Status::FiatSent, &order).await {
Ok(order) => order.update(pool).await?,
Err(_) => {
error!("Can't update order {}!", order.id);
error!("Failed to update order {}: {}", order.id, e);
return Ok(());
}
};
Expand Down Expand Up @@ -106,7 +106,13 @@ pub async fn fiat_sent_action(
if let Some((pubkey, index)) = next_trade {
order_updated.next_trade_pubkey = Some(pubkey.clone());
order_updated.next_trade_index = Some(index as i64);
order_updated.update(pool).await?;
if let Err(e) = order_updated.update(pool).await {
error!(
"Failed to update next trade fields for order {}: {}",
order_id, e
);
return Ok(());
}
}
}

Expand Down

0 comments on commit 2fd7a66

Please sign in to comment.