Interpret some types of Postgres errors to be user facing#76
Merged
Conversation
a18333c to
c53cd3d
Compare
A partial fix for #73. Instead of always returning an internal error on problems like insufficient privileges, instead return a user-facing API error with a description of what's wrong. This is only a partial fix because it requires the new API infrastructure from #71 to work properly, so we'll need to convert the rest of the endpoints over for it to be fully effective. One possibility is that we might want to just take any kind of `*pgconn.PgError` and change that to a user-facing error. I didn't do that here, but it strikes me as fairly plausible. I figure we should maybe wait for one more type of error that's commonly encountered before taking this step.
c53cd3d to
3520806
Compare
bgentry
approved these changes
Jun 29, 2024
Collaborator
Author
|
Great, thx. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A partial fix for #73. Instead of always returning an internal error on
problems like insufficient privileges, instead return a user-facing API
error with a description of what's wrong.
This is only a partial fix because it requires the new API
infrastructure from #71 to work properly, so we'll need to convert the
rest of the endpoints over for it to be fully effective.
One possibility is that we might want to just take any kind of
*pgconn.PgErrorand change that to a user-facing error. I didn't dothat here, but it strikes me as fairly plausible. I figure we should
maybe wait for one more type of error that's commonly encountered before
taking this step.