我尝试捕获 DeadlineExceededException。
try
{
Client restletClient = new Client(Protocol.HTTP);
Request req = new Request(Method.GET, urltocall);
Response res = restletClient.handle(req);
log.info("The status of the response : " + res.getStatus());
responseContent = res.getEntity().getText();
log.info("Content is : " + responseContent);
}
catch(DeadlineExceededException e)
{
log.log(java.util.logging.Level.SEVERE,e.getMessage(),e);
log.info("Inside catch block send mail to client service team!");
response.sendRedirect("/Messages");
}
但是,我无法捕捉。有没有其他方法可以捕捉?