Permalink
Browse files

bugfix: now we log an error message when the postgres_pass target is …

…not found at all and returns 500 in this case instead of returning empty response.
  • Loading branch information...
agentzh authored and PiotrSikora committed Nov 4, 2011
1 parent bcdcc62 commit 0bd9db4e0ab799ad08a4052d4fdfd8f73231147e
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/ngx_postgres_handler.c
@@ -141,8 +141,11 @@ ngx_postgres_handler(ngx_http_request_t *r)
pglcf->upstream.upstream = ngx_postgres_find_upstream(r, &url);
if (pglcf->upstream.upstream == NULL) {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "postgres: upstream name \"%V\" not found", &host);
+
dd("returning NGX_ERROR");
- return NGX_ERROR;
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
}

0 comments on commit 0bd9db4

Please sign in to comment.