Issue #21: stacktrace при connection time out заменен на более простую форму
This commit is contained in:
@@ -170,7 +170,24 @@ public class WebAppController {
|
||||
con.setRequestProperty(headerName, request.getHeader(headerName));
|
||||
}
|
||||
|
||||
con.connect();
|
||||
boolean connected;
|
||||
int _try = 0;
|
||||
do {
|
||||
try {
|
||||
con.connect();
|
||||
connected = true;
|
||||
} catch (IOException e) {
|
||||
con.disconnect();
|
||||
connected = false;
|
||||
_try++;
|
||||
logger.log(Level.WARNING,String.format("Error connection to '%s': '%s'. Try again...", url.toString(), e.getMessage()));
|
||||
}
|
||||
} while (!connected && _try < 3);
|
||||
|
||||
if (!connected) {
|
||||
response.sendError(524);
|
||||
return;
|
||||
}
|
||||
|
||||
int statusCode = con.getResponseCode();
|
||||
response.setStatus(statusCode);
|
||||
|
||||
Reference in New Issue
Block a user