Skip to content

fix(errors): surface Supabase query errors instead of swallowing them#237

Merged
Azfe merged 2 commits into
developfrom
fix/surface-postgrest-errors
Jul 11, 2026
Merged

fix(errors): surface Supabase query errors instead of swallowing them#237
Azfe merged 2 commits into
developfrom
fix/surface-postgrest-errors

Conversation

@Azfe

@Azfe Azfe commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

PostgrestError is a plain object, not a subclass of Error (unlike AuthError, StorageError and FunctionsError), so e instanceof Error was false for any failed query: every call site fell back to a generic literal and dropped the real message — a broken feed showed "Error al cargar" with no trace anywhere.

Add errorMessage() / reportError(), which log the underlying error and return the user-facing text, and route the six database call sites through them: useFeed, usePostEngagementMetrics, useUserList and the profile screen. Postgres jargon stays out of the UI but is no longer lost.

@Azfe
Azfe merged commit e1dda58 into develop Jul 11, 2026
6 checks passed
@Azfe
Azfe deleted the fix/surface-postgrest-errors branch July 11, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant