FRiCKLE / ngx_postgres

upstream module that allows nginx to communicate directly with PostgreSQL database.
http://labs.frickle.com/nginx_ngx_postgres/
BSD 2-Clause "Simplified" License
545 stars 122 forks source link

add $postgres_error variable #36

Open niquola opened 9 years ago

0x6e6562 commented 9 years ago

Could you give an example of how you would use this?

niquola commented 9 years ago

This patch is implementation of ideas discussed in #8. $postgres_error variable could be used by other modules to report error:

add_after_body $postgres_error;
more_set_headers "X-Error: $postgres_error";

In our case, we've created simple postgresql web console based on ngx_postgres and showing error messages is critical for UX.