Skip to content

Commit 8a8fd74

Browse files
author
Devendra
committed
[#75463102] catch exception while calling disconnect on connection
1 parent 973a93d commit 8a8fd74

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎java/src1/com/pubnub/api/HttpClientCore.java‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public synchronized HttpResponse fetch(String url, Hashtable headers)
130130
throw new PubnubException(getErrorObject(PNERROBJ_CONNECT_EXCEPTION, url + " : " + e.toString()));
131131
}
132132
*/
133-
134133
int rc = HttpURLConnection.HTTP_INTERNAL_ERROR;
135134
try {
136135
rc = connection.getResponseCode();
@@ -141,7 +140,6 @@ public synchronized HttpResponse fetch(String url, Hashtable headers)
141140
throw new PubnubException(getErrorObject(PNERROBJ_HTTP_RC_ERROR, url + " : " + e.toString()));
142141
}
143142

144-
145143
InputStream is = null;
146144
String encoding = connection.getContentEncoding();
147145

@@ -250,7 +248,12 @@ public boolean isOk(int rc) {
250248
}
251249

252250
public void shutdown() {
253-
if (connection != null) connection.disconnect();
251+
if (connection != null) {
252+
try {
253+
connection.disconnect();
254+
} catch (Exception e) {
255+
}
256+
}
254257
}
255258
}
256259

0 commit comments

Comments
 (0)