We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44e6e00 commit 1eb8fa1Copy full SHA for 1eb8fa1
src/main/java/ru/mystamps/web/service/HttpURLConnectionDownloaderService.java
@@ -21,6 +21,7 @@
21
import java.io.FileNotFoundException;
22
import java.io.IOException;
23
import java.io.InputStream;
24
+import java.net.ConnectException;
25
import java.net.HttpURLConnection;
26
import java.net.MalformedURLException;
27
import java.net.URL;
@@ -146,7 +147,11 @@ private static Code connect(HttpURLConnection conn) {
146
147
try {
148
conn.connect();
149
return Code.SUCCESS;
-
150
+
151
+ } catch (ConnectException ignored) {
152
+ LOG.debug("Couldn't download file: connect() has failed");
153
+ return Code.UNEXPECTED_ERROR;
154
155
} catch (IOException ex) {
156
LOG.debug("Couldn't download file: connect() has failed", ex);
157
return Code.UNEXPECTED_ERROR;
0 commit comments