Skip to content

gh-275: Propagate exceptions as a RuntimeException instead of java.lang.Error #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.gitlab.api.GitlabAPI;
import org.gitlab.api.GitlabAPIException;
import org.gitlab.api.TokenType;
import org.gitlab.api.models.GitlabCommit;

/**
* Gitlab HTTP Requestor
Expand Down Expand Up @@ -121,7 +120,7 @@ public GitlabHTTPRequestor with(String key, Object value) {
* Has a fluent api for method chaining
*
* @param key Form parameter Key
* @param value Form parameter Value
* @param file File data
* @return this
*/
public GitlabHTTPRequestor withAttachment(String key, File file) {
Expand Down Expand Up @@ -208,7 +207,7 @@ public <T> Iterator<T> asIterator(final String tailApiUrl, final Class<T> type)
try {
url = root.getAPIUrl(tailApiUrl);
} catch (IOException e) {
throw new Error(e);
throw new RuntimeException(e);
}
}

Expand Down Expand Up @@ -260,7 +259,7 @@ private void fetch() {
handleAPIError(e, connection);
}
} catch (IOException e) {
throw new Error(e);
throw new RuntimeException(e);
}
}

Expand Down