in java/com/google/gitiles/DefaultErrorHandlingFilter.java [46:88]
public void doFilter(HttpServletRequest req, HttpServletResponse res, FilterChain chain)
throws IOException, ServletException {
try {
chain.doFilter(req, res);
} catch (GitilesRequestFailureException e) {
try {
res.setHeader(GITILES_ERROR, e.getReason().toString());
renderHtml(req, res, e.getReason().getHttpStatusCode(), e.getPublicErrorMessage());
} catch (IOException e2) {
e.addSuppressed(e2);
throw e;
}
} catch (RepositoryNotFoundException e) {
try {
renderHtml(req, res, FailureReason.REPOSITORY_NOT_FOUND);
} catch (IOException e2) {
e.addSuppressed(e2);
throw e;
}
} catch (AmbiguousObjectException e) {
try {
renderHtml(req, res, FailureReason.AMBIGUOUS_OBJECT);
} catch (IOException e2) {
e.addSuppressed(e2);
throw e;
}
} catch (ServiceMayNotContinueException e) {
try {
renderHtml(req, res, e.getStatusCode(), e.getMessage());
} catch (IOException e2) {
e.addSuppressed(e2);
throw e;
}
} catch (IOException | ServletException e) {
try {
log.warn("Internal server error", e);
renderHtml(req, res, FailureReason.INTERNAL_SERVER_ERROR);
} catch (IOException e2) {
e.addSuppressed(e2);
throw e;
}
}
}