mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-07 16:08:02 +08:00
fix(grok): normalize refresh errors
This commit is contained in:
@@ -327,7 +327,7 @@ func (api *OAuthRefreshAPI) RefreshIfNeeded(
|
||||
readErr = fmt.Errorf("account not found after Grok OAuth success CAS miss")
|
||||
}
|
||||
return nil, &providerCycleContainmentRefreshError{
|
||||
err: fmt.Errorf("Grok OAuth success CAS lost and current state is unavailable: %w", readErr),
|
||||
err: fmt.Errorf("grok OAuth success CAS lost and current state is unavailable: %w", readErr),
|
||||
}
|
||||
}
|
||||
slog.Info("oauth_refresh_success_cas_skipped_stale_credentials",
|
||||
@@ -342,7 +342,7 @@ func (api *OAuthRefreshAPI) RefreshIfNeeded(
|
||||
readErr = fmt.Errorf("account not found after Grok OAuth success CAS")
|
||||
}
|
||||
return nil, &providerCycleContainmentRefreshError{
|
||||
err: fmt.Errorf("Grok OAuth success persisted but durable account state is unavailable: %w", readErr),
|
||||
err: fmt.Errorf("grok OAuth success persisted but durable account state is unavailable: %w", readErr),
|
||||
}
|
||||
}
|
||||
// The CAS changes credentials only. A concurrent admin or scheduler
|
||||
|
||||
@@ -996,7 +996,7 @@ func (s *TokenRefreshService) refreshWithRetryWithRateGate(
|
||||
conditionalRepo, ok := s.accountRepo.(GrokOAuthRefreshMutationRepository)
|
||||
if !ok {
|
||||
return &providerConfigurationRefreshError{
|
||||
err: errors.New("Grok OAuth conditional refresh mutation repository is not configured"),
|
||||
err: errors.New("grok OAuth conditional refresh mutation repository is not configured"),
|
||||
}
|
||||
} else {
|
||||
persistentlyBlocked, setErr = conditionalRepo.SetGrokOAuthRefreshErrorIfCredentialsUnchanged(
|
||||
@@ -1091,7 +1091,7 @@ func (s *TokenRefreshService) refreshWithRetryWithRateGate(
|
||||
conditionalRepo, ok := s.accountRepo.(GrokOAuthRefreshMutationRepository)
|
||||
if !ok {
|
||||
return &providerConfigurationRefreshError{
|
||||
err: errors.New("Grok OAuth conditional refresh mutation repository is not configured"),
|
||||
err: errors.New("grok OAuth conditional refresh mutation repository is not configured"),
|
||||
}
|
||||
}
|
||||
applied, setErr := conditionalRepo.SetGrokOAuthRefreshTempUnschedulableIfCredentialsUnchanged(
|
||||
|
||||
Reference in New Issue
Block a user