@supabase/auth-js 2.112.0 → 2.112.1-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/auth-js",
3
- "version": "2.112.0",
3
+ "version": "2.112.1-canary.0",
4
4
  "private": false,
5
5
  "description": "Official SDK for Supabase Auth",
6
6
  "keywords": [
package/src/lib/fetch.ts CHANGED
@@ -81,18 +81,22 @@ export async function handleError(error: unknown) {
81
81
  throw new AuthRetryableFetchError(_getErrorMessage(error), 0)
82
82
  }
83
83
 
84
- if (NETWORK_ERROR_CODES.includes(error.status)) {
85
- // status in 500...599 range - server had an error, request might be retryed.
86
- throw new AuthRetryableFetchError(_getErrorMessage(error), error.status)
87
- }
88
-
89
84
  let data: any
90
85
  try {
91
86
  data = await error.json()
92
87
  } catch (e) {
88
+ if (NETWORK_ERROR_CODES.includes(error.status)) {
89
+ // statusText can be empty — HTTP/2 has no reason phrase
90
+ throw new AuthRetryableFetchError(error.statusText || `HTTP ${error.status}`, error.status)
91
+ }
93
92
  throw new AuthUnknownError(_getErrorMessage(e), e)
94
93
  }
95
94
 
95
+ if (NETWORK_ERROR_CODES.includes(error.status)) {
96
+ // status in 500...599 range - server had an error, request might be retryed.
97
+ throw new AuthRetryableFetchError(_getErrorMessage(data), error.status)
98
+ }
99
+
96
100
  let errorCode: string | undefined = undefined
97
101
 
98
102
  const responseAPIVersion = parseResponseAPIVersion(error)
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.112.0'
7
+ export const version = '2.112.1-canary.0'