Skip to content

Commit

Permalink
Improve Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch committed Dec 18, 2024
1 parent 58c462e commit 7bd6a44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cli/add_invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

0 comments on commit 7bd6a44

Please sign in to comment.