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.
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.