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

Handle RPC errors #168

Merged
merged 8 commits into from
Oct 31, 2024
Merged

Handle RPC errors #168

merged 8 commits into from
Oct 31, 2024

Conversation

TheRangiCrew
Copy link
Contributor

@TheRangiCrew TheRangiCrew commented Oct 29, 2024

When a query fails, such as invalid syntax, an RPC error is returned. However, at the moment this is only logged to the terminal rather than returned as an error meaning there is no way to tell if a query failed on the database.

Wondering if we can fix this...

Fixes #172

The idea is to just create another response channel in the WebSocket that listens for errors. The Send() method could then use that channel to return an error which would be the message returned from SurrealDB. Previously an error would never be returned by Send() leaving any failed queries to still wait for a response, preventing higher functions from returning.

@TheRangiCrew TheRangiCrew marked this pull request as ready for review October 29, 2024 02:54
@remade remade changed the base branch from main to fix-feedback-issues October 31, 2024 12:19
@remade remade changed the base branch from fix-feedback-issues to main October 31, 2024 12:20
@remade remade merged commit 8448815 into surrealdb:main Oct 31, 2024
4 checks passed
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.

Bug: RPC errors logged, not gracefully handled
2 participants