Skip to content

Commit 1b3dae4

Browse files
Jaye Pitzerusetimols
authored andcommitted
gh-275: Propagate exceptions as a RuntimeException instead of java.lang.Error (#281)
1 parent cb51a38 commit 1b3dae4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.gitlab.api.GitlabAPI;
2525
import org.gitlab.api.GitlabAPIException;
2626
import org.gitlab.api.TokenType;
27-
import org.gitlab.api.models.GitlabCommit;
2827

2928
/**
3029
* Gitlab HTTP Requestor
@@ -121,7 +120,7 @@ public GitlabHTTPRequestor with(String key, Object value) {
121120
* Has a fluent api for method chaining
122121
*
123122
* @param key Form parameter Key
124-
* @param value Form parameter Value
123+
* @param file File data
125124
* @return this
126125
*/
127126
public GitlabHTTPRequestor withAttachment(String key, File file) {
@@ -208,7 +207,7 @@ public <T> Iterator<T> asIterator(final String tailApiUrl, final Class<T> type)
208207
try {
209208
url = root.getAPIUrl(tailApiUrl);
210209
} catch (IOException e) {
211-
throw new Error(e);
210+
throw new RuntimeException(e);
212211
}
213212
}
214213

@@ -260,7 +259,7 @@ private void fetch() {
260259
handleAPIError(e, connection);
261260
}
262261
} catch (IOException e) {
263-
throw new Error(e);
262+
throw new RuntimeException(e);
264263
}
265264
}
266265

0 commit comments

Comments
 (0)