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
This commit is contained in:
Emma Alexia 2025-05-30 12:28:00 -04:00 committed by GitHub
parent a9cfc37aac
commit b66d99c59c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,9 +193,12 @@ impl PayoutsQueue {
pub error_description: String,
}
if let Ok(error) =
if let Ok(mut error) =
serde_json::from_value::<PayPalError>(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