Skip to content

Commit 9a9e527

Browse files
islandsvinurtimols
authored andcommitted
Throw UncheckedIOException instead of generic RuntimeException (timols#339)
* Throw UncheckedIOException instead of generic RuntimeException * Add missing import
1 parent b17095c commit 9a9e527

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.io.OutputStreamWriter;
1111
import java.io.PrintWriter;
1212
import java.io.Reader;
13+
import java.io.UncheckedIOException;
1314
import java.lang.reflect.Field;
1415
import java.net.*;
1516
import java.util.*;
@@ -188,7 +189,7 @@ public <T> Iterator<T> asIterator(final String tailApiUrl, final Class<T> type)
188189
try {
189190
url = root.getAPIUrl(tailApiUrl);
190191
} catch (IOException e) {
191-
throw new RuntimeException(e);
192+
throw new UncheckedIOException(e);
192193
}
193194
}
194195

@@ -240,7 +241,7 @@ private void fetch() {
240241
handleAPIError(e, connection);
241242
}
242243
} catch (IOException e) {
243-
throw new RuntimeException(e);
244+
throw new UncheckedIOException(e);
244245
}
245246
}
246247

0 commit comments

Comments
 (0)