pub fn error_response(error: Error, verbatim_db_errors: bool) -> Response<Bytes>Expand description
Build an error response.
In production mode (PGRST_DEBUG=false or unset), sensitive error details are hidden to prevent information leakage. Build the response for a failed request.
verbatim_db_errors passes a database failure through as PostgreSQL
reported it – its SQLSTATE, message, detail and hint – which is what
PostgREST does and what a client written against PostgREST branches on.
AppConfig::verbatim_db_error
decides it: off unless compatibility mode is on or the SQLSTATE is one
PGRST_DB_ERRORS_VERBATIM lists, because those fields mostly describe the
schema rather than the request: a constraint’s name, a column that was not
selected, the text of a failing query. Everything else is reported the
same either way.