From 7bd6a445de4c2dfb3ed154f05387f868a33eed6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Wed, 18 Dec 2024 17:43:52 -0300 Subject: [PATCH] Improve Error handling --- src/cli/add_invoice.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli/add_invoice.rs b/src/cli/add_invoice.rs index a85b0c5..9188c6f 100644 --- a/src/cli/add_invoice.rs +++ b/src/cli/add_invoice.rs @@ -68,14 +68,14 @@ pub async fn execute_add_invoice( println!("Now we should wait for the seller to pay the invoice"); } }); - order + match order .set_status(Status::WaitingPayment.to_string()) .save(&pool) .await - .map_err(|e| { - println!("Failed to update order status: {}", e); - e - })?; + { + Ok(_) => println!("Order status updated"), + Err(e) => println!("Failed to update order status: {}", e), + } Ok(()) }