Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 Realtime error handling #234

Open
EskelCz opened this issue Mar 23, 2023 · 2 comments
Open

V2 Realtime error handling #234

EskelCz opened this issue Mar 23, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@EskelCz
Copy link

EskelCz commented Mar 23, 2023

Improve documentation

Links

https://supabase.com/realtime
https://supabase.com/docs/guides/realtime/extensions/postgres-changes

Describe the problem

Haven't found a single mention of error handling. Nothing in google results or github issues either. How should I catch errors? (from exceeding limits for example)
Should I just wrap the channel subscription in a try-catch block?
Thank you.

@EskelCz EskelCz added the documentation Improvements or additions to documentation label Mar 23, 2023
@EskelCz EskelCz changed the title Realtime error handling V2 Realtime error handling Mar 23, 2023
@soedirgo soedirgo transferred this issue from supabase/supabase-js Mar 24, 2023
@kevinco26
Copy link

+1 to this
@RamiroND @soedirgo

@w3b6x9
Copy link
Member

w3b6x9 commented Nov 28, 2023

the two places that a channel subscriber can check are upon initial subscription and during an active subscription.

when a channel is attempting to subscribe it can check the status:

...
myChannel.subscribe((status) => {
  console.log(status)
  if (status !== 'SUBSCRIBED') { return }
  ...
})

in order to check if a channel has been rate limited or there was an issue with postgres changes the channel can subscribe to system messages. see supabase/realtime#282 (comment) and https://supabase.com/docs/guides/realtime/protocol#system-messages for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants