Skip to content

Commit 7bd6a44

Browse files
committed
Improve Error handling
1 parent 58c462e commit 7bd6a44

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cli/add_invoice.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ pub async fn execute_add_invoice(
6868
println!("Now we should wait for the seller to pay the invoice");
6969
}
7070
});
71-
order
71+
match order
7272
.set_status(Status::WaitingPayment.to_string())
7373
.save(&pool)
7474
.await
75-
.map_err(|e| {
76-
println!("Failed to update order status: {}", e);
77-
e
78-
})?;
75+
{
76+
Ok(_) => println!("Order status updated"),
77+
Err(e) => println!("Failed to update order status: {}", e),
78+
}
7979

8080
Ok(())
8181
}

0 commit comments

Comments
 (0)