Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(web,sentry): handle Safari "TypeError: Load failed" network errors

(justin)randoneeringe7dfcfa44a8f
diff --git a/apps/web/src/instrument.ts b/apps/web/src/instrument.ts
index 600d9d731..f4d93bbc5 100644
--- a/apps/web/src/instrument.ts
+++ b/apps/web/src/instrument.ts
@@ -16,6 +16,10 @@ if (dsn && !dsn.startsWith("KANEO_")) {
// Thrown by Facebook's in-app browser (Android) navigation performance logger
// calling postMessage on a destroyed WebView Java bridge; not caused by kaneo code.
"Error invoking postMessage: Java object is gone",
+ // Safari's equivalent of Chrome's "Failed to fetch" — thrown when a fetch()
+ // request fails due to a transient network error (e.g. dropped mobile connection).
+ // Occurs on iOS/Safari during authClient.getSession() and is not a bug in kaneo code.
+ "Load failed",
],
integrations: [
Sentry.browserTracingIntegration(),
diff --git a/apps/web/src/lib/error-handler.ts b/apps/web/src/lib/error-handler.ts
index 277ac4b50..c34d55e17 100644
--- a/apps/web/src/lib/error-handler.ts
+++ b/apps/web/src/lib/error-handler.ts
@@ -9,6 +9,7 @@ export function parseApiError(error: unknown): ApiError {
if (error instanceof Error) {
if (
error.message.includes("Failed to fetch") ||
+ error.message.includes("Load failed") ||
error.message.includes("NetworkError") ||
error.message.includes("CORS")
) {