RestApiServlet: log exceptions if REST-API status >= 400
Do not swallow the exceptions that caused REST-API to return with a status >= 400. Include the associated exception as the cause with the relevant stack-trace so that a Gerrit administrator, by enabling the log for the RestApiServlet class can troubleshoot the problem and make the necessary fixes to the configuration or potentially identify a bug in Gerrit. Bug: Issue 11110 Change-Id: I1865df0beb3206d637c0308569857f1316e1a292
This commit is contained in:
@@ -1442,7 +1442,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
configureCaching(req, res, null, null, c);
|
||||
checkArgument(statusCode >= 400, "non-error status: %s", statusCode);
|
||||
res.setStatus(statusCode);
|
||||
logger.atFinest().log("REST call failed: %d", statusCode);
|
||||
logger.atFinest().withCause(err).log("REST call failed: %d", statusCode);
|
||||
return replyText(req, res, true, msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user