Source:
<code>public String execute(String request, int connectTimeout, int readTimeout) { String response = null; HttpsURLConnection connection = null; try { request = checkSessionToken(request); connection = getConnection(request, connectTimeout, readTimeout); if (connection != null) { connection.connect(); if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { response = IOUtils.toString(connection.getInputStream()); if (!response.contains("Authentication failed")) { if (loginCounter > 0) { connectionManager.checkConnection(connection.getResponseCode()); } loginCounter = 0; } else { connectionManager.checkConnection(-6); loginCounter++; } } connection.disconnect(); if (response == null && connectionManager != null && loginCounter < 2) { if (connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) { execute(addSessionToken(request, connectionManager.getNewSessionToken()), connectTimeout, readTimeout); loginCounter++; } else { connectionManager.checkConnection(connection.getResponseCode()); loginCounter++; return null; } } return response; } } catch (SocketTimeoutException e) { <START> informConnectionManager(-4); <END> } catch (java.net.ConnectException e) { informConnectionManager(-3); } catch (MalformedURLException e) { informConnectionManager(-2); } catch (IOException e) { if (e instanceof java.net.ConnectException) { informConnectionManager(-3); } else if (e instanceof java.net.UnknownHostException) { informConnectionManager(-5); } else if (connectionManager != null) { informConnectionManager(-1); } } finally { if (connection != null) { connection.disconnect(); } } return null; }</code><technical_language>inform connection manager a "magic" integer instead of passing exception</technical_language>

Target:
public String execute(String request, int connectTimeout, int readTimeout) { String response = null; HttpsURLConnection connection = null; try { request = checkSessionToken(request); connection = getConnection(request, connectTimeout, readTimeout); if (connection != null) { connection.connect(); if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { response = IOUtils.toString(connection.getInputStream()); if (!response.contains("Authentication failed")) { if (loginCounter > 0) { connectionManager.checkConnection(connection.getResponseCode()); } loginCounter = 0; } else { connectionManager.checkConnection(ConnectionManager.AUTHENTIFICATION_PROBLEM); loginCounter++; } } connection.disconnect(); if (response == null && connectionManager != null && loginCounter <= mayANewSessionTokenIsNeeded) { if (connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) { execute(addSessionToken(request, connectionManager.getNewSessionToken()), connectTimeout, readTimeout); loginCounter++; } else { connectionManager.checkConnection(connection.getResponseCode()); loginCounter++; return null; } } return response; } } catch (SocketTimeoutException e) { informConnectionManager(ConnectionManager.SOCKET_TIMEOUT_EXCEPTION); } catch (java.net.ConnectException e) { informConnectionManager(ConnectionManager.CONNECTION_EXCEPTION); } catch (MalformedURLException e) { informConnectionManager(ConnectionManager.MALFORMED_URL_EXCEPTION); } catch (java.net.UnknownHostException e) { informConnectionManager(ConnectionManager.UNKNOWN_HOST_EXCEPTION); } catch (IOException e) { if (connectionManager != null) { informConnectionManager(ConnectionManager.GENERAL_EXCEPTION); } } finally { if (connection != null) { connection.disconnect(); } } return null; }