88import org .jetbrains .annotations .Nullable ;
99
1010import java .io .BufferedReader ;
11- import java .io .IOException ;
1211import java .io .InputStreamReader ;
1312import java .net .HttpURLConnection ;
1413import java .net .URI ;
@@ -50,7 +49,7 @@ public static <T> Optional<T> get(@NotNull String userAgent, @NotNull String url
5049 return Optional .empty ();
5150 }
5251 result = function .apply (new InputStreamReader (connection .getInputStream ()));
53- } catch (final IOException e ) {
52+ } catch (final Exception e ) {
5453 if (DEBUG ) e .printStackTrace ();
5554 }
5655 if (connection != null ) connection .disconnect ();
@@ -107,7 +106,7 @@ public static int postJson(@NotNull String userAgent, @NotNull String urlString,
107106 if (connectionConsumer != null ) connectionConsumer .accept (connection );
108107 if (data != null ) connection .getOutputStream ().write (data .toString ().getBytes ());
109108 responseCode = connection .getResponseCode ();
110- } catch (final IOException e ) {
109+ } catch (final Exception e ) {
111110 if (DEBUG ) e .printStackTrace ();
112111 }
113112 if (connection != null ) connection .disconnect ();
@@ -136,7 +135,7 @@ public static int putJson(@NotNull String userAgent, @NotNull String urlString,
136135 if (connectionConsumer != null ) connectionConsumer .accept (connection );
137136 if (data != null ) connection .getOutputStream ().write (data .toString ().getBytes ());
138137 responseCode = connection .getResponseCode ();
139- } catch (final IOException e ) {
138+ } catch (final Exception e ) {
140139 if (DEBUG ) e .printStackTrace ();
141140 }
142141 if (connection != null ) connection .disconnect ();
@@ -161,7 +160,7 @@ public static int delete(@NotNull String userAgent, @NotNull String urlString, @
161160 connection .setRequestProperty ("User-Agent" , userAgent );
162161 if (connectionConsumer != null ) connectionConsumer .accept (connection );
163162 responseCode = connection .getResponseCode ();
164- } catch (final IOException e ) {
163+ } catch (final Exception e ) {
165164 if (DEBUG ) e .printStackTrace ();
166165 }
167166 if (connection != null ) connection .disconnect ();
0 commit comments