mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
Improve error handling in account balance notifications (#6478)
* Improve error handling in account balance notifications * fix compile
This commit is contained in:
@@ -70,7 +70,11 @@ impl TiltifyClient {
|
||||
}
|
||||
|
||||
if state.rate_limited_until > Instant::now() {
|
||||
return Err(eyre!("waiting for rate limit to reset"));
|
||||
return Err(eyre!(
|
||||
"waiting for rate limit to reset at {:.0?} (backoff {:.0?})",
|
||||
state.rate_limited_until,
|
||||
state.rate_limit_backoff
|
||||
));
|
||||
}
|
||||
|
||||
if ENV.TILTIFY_CLIENT_ID.is_empty()
|
||||
|
||||
@@ -198,13 +198,22 @@ impl PayoutSourceAlertType {
|
||||
threshold,
|
||||
current_balance,
|
||||
} => format!(
|
||||
"\u{1f6a8} *Payout Source Alert*\n\nPayout source '{source}' has an available balance under the ${threshold} threshold.\nBalance: ${current_balance}."
|
||||
"\u{1f6a8} *Payout Source Alert*
|
||||
|
||||
Payout source '{source}' has an available balance under the ${threshold} threshold.
|
||||
Balance: ${current_balance}."
|
||||
),
|
||||
PayoutSourceAlertType::CheckFailure {
|
||||
source,
|
||||
display_error,
|
||||
} => format!(
|
||||
"\u{1f6a8} *Payout Source Alert*\n\nFAILED TO CHECK payout source '{source}' balance.\nError: {display_error}"
|
||||
"\u{1f6a8} *Payout Source Alert*
|
||||
|
||||
Failed to check payout source '{source}' balance.
|
||||
Error:
|
||||
```
|
||||
{display_error}
|
||||
```"
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user