Improve error handling in account balance notifications (#6478)

* Improve error handling in account balance notifications

* fix compile
This commit is contained in:
aecsocket
2026-06-23 21:11:02 +00:00
committed by GitHub
parent 6380dd16d5
commit 7bf85239de
4 changed files with 57 additions and 26 deletions
+5 -1
View File
@@ -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()
+11 -2
View File
@@ -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}
```"
),
}
}