From b66d99c59cfe35488f84ad01933ec291f249648b Mon Sep 17 00:00:00 2001 From: Emma Alexia Date: Fri, 30 May 2025 12:28:00 -0400 Subject: [PATCH] Improve error when Modrinth's PayPal account is out of funds (#3718) * Improve error when Modrinth's PayPal account is out of funds * improve msg --- apps/labrinth/src/queue/payouts.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/labrinth/src/queue/payouts.rs b/apps/labrinth/src/queue/payouts.rs index b6e950317..69269b021 100644 --- a/apps/labrinth/src/queue/payouts.rs +++ b/apps/labrinth/src/queue/payouts.rs @@ -193,9 +193,12 @@ impl PayoutsQueue { pub error_description: String, } - if let Ok(error) = + if let Ok(mut error) = serde_json::from_value::(value.clone()) { + if error.name == "INSUFFICIENT_FUNDS" { + error.message = "We're currently transferring funds to our PayPal account. Please try again in a couple days.".to_string(); + } return Err(ApiError::Payments(format!( "error name: {}, message: {}", error.name, error.message