refactor: reuse is_auth_error from provider.rs, DRY backend retry logic

This commit is contained in:
asepharyana
2026-07-18 03:18:27 +07:00
parent 431c8d3b89
commit ff47bffe0c
3 changed files with 4 additions and 13 deletions
@@ -57,7 +57,7 @@ fn backoff_duration(attempt: u32) -> Duration {
/// request builders below, plus well-known auth keywords in case the body
/// contains them. This is intentionally tighter than `contains("401")`,
/// which could false-positive on a URL port, model name, or body text.
fn is_auth_error(err_str: &str) -> bool {
pub fn is_auth_error(err_str: &str) -> bool {
let err_lower = err_str.to_lowercase();
// Structured HTTP status patterns
(err_str.contains("API error 401")