riverqueue / riverui

A web interface for River, fast and reliable background jobs in Go.
https://ui.riverqueue.com/
Mozilla Public License 2.0
43 stars 3 forks source link

Interpret some types of Postgres errors to be user facing #76

Closed brandur closed 3 days ago

brandur commented 4 days ago

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.

brandur commented 3 days ago

Great, thx.