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

feat: improve restConnector error handling #650

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

kwonoh
Copy link
Contributor

@kwonoh kwonoh commented Jan 9, 2025

The Rust server sends error messages to the client if the query fails (e.g., SQL syntax error, incorrect column name).
However, the current restConnector does not handle the error message from the server and tries to parse the response just based on the request type.

This PR adds a check whether the response was successful. If the response is not ok, then it throws an error with the response text that contains the error messages from the server.

With this change, queryError receives an Error instance with the error message from the server.

The error message format could be improved.

Copy link
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Looks good and throwing an error will reject the promise.

@domoritz domoritz merged commit 79e0218 into uwdata:main Jan 9, 2025
3 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.

2 participants