security-proxy - Intercept "connection refused" errors #963

Merged
merged 1 commit into from Apr 21, 2015

Projects

None yet

2 participants

@pmauduit
Member

This PR is related to the issue #961.

If underlying webapps are unavailable, an empty webpage is produced
(Content-length: 0), no log traces are produced (a printStackTrace() is
done anyway), and a 200 OK status code is returned.

This commit provides:

  • A 503 "service unavailable" status code is returned instead
  • A default status page for 503 (as it is currently done for 403 and 404
    statuses) is produced,
  • A log trace is correctly (in the correct log file, not on stdout) is
    printed.

Note that the 503 error code can also be intercepted by the frontend
server, so that a custom error page is returned.

@fvanderbiest fvanderbiest and 1 other commented on an outdated diff Apr 21, 2015
...oxy/src/main/java/org/georchestra/security/Proxy.java
@@ -612,7 +612,13 @@ private void handleRequest(HttpServletRequest request, HttpServletResponse final
}
} catch (IOException e) {
// connection problem with the host
- e.printStackTrace();
+ logger.error("Exception occured when trying to connect onto the remote host: ", e);
@fvanderbiest
Member

Looks good !

@pmauduit pmauduit security-proxy - Intercept "connection refused" errors
If underlying webapps are unavailable, an empty webpage is produced
(Content-length: 0), no log traces are produced (a printStackTrace() is
done anyway), and a 200 OK status code is returned.

This commit provides:
- A 503 "service unavailable" status code is returned instead
- A default status page for 503 (as it is currently done for 403 and 404
  statuses) is produced,
- A log trace is correctly (in the correct log file, not on stdout) is
  printed.

Note that the 503 error code can also be intercepted by the frontend
server, so that a custom error page is returned.
effd316
@fvanderbiest fvanderbiest merged commit 002db53 into georchestra:master Apr 21, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@fvanderbiest fvanderbiest added this to the 15.06 milestone Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment