Skip to content

Commit

Permalink
fix(auth): URLError coercion for RetryableError causing session t…
Browse files Browse the repository at this point in the history
…o be deleted (#597)

* Fixes url error coercion

* Include non-url errors
  • Loading branch information
stephenth0ma5 authored Nov 12, 2024
1 parent 425a99f commit d67b7cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Auth/Internal/SessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ private actor LiveSessionManager {
// Need to do this check here, because not all RetryableError's should be retried.
// URLError conforms to RetryableError, but only a subset of URLError should be retried,
// the same is true for AuthError.
if let error = error as? any RetryableError, error.shouldRetry {
if let error = error as? URLError, error.shouldRetry {
throw error
} else if let error = error as? any RetryableError, error.shouldRetry {
throw error
} else {
remove()
Expand Down

0 comments on commit d67b7cf

Please sign in to comment.