Skip to content

Commit 1d6da58

Browse files
committed
Update GitHubRepositoryController.java
1 parent b77840a commit 1d6da58

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/pl/koder95/eme/git/GitHubRepositoryController.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
package pl.koder95.eme.git;
1818

1919
import org.kohsuke.github.*;
20+
import org.kohsuke.github.connector.GitHubConnectorResponse;
2021

2122
import java.io.IOException;
22-
import java.net.HttpURLConnection;
2323

2424
import static pl.koder95.eme.Main.BUNDLE;
2525

@@ -33,11 +33,10 @@
3333
public class GitHubRepositoryController {
3434

3535
private GitHub createNewConnection() throws IOException {
36-
return new GitHubBuilder().withRateLimitHandler(new RateLimitHandler() {
36+
return new GitHubBuilder().withRateLimitHandler(new GitHubRateLimitHandler() {
3737
@Override
38-
public void onError(IOException e, HttpURLConnection uc) {
39-
System.out.println(uc);
40-
e.printStackTrace();
38+
public void onError(GitHubConnectorResponse connectorResponse) {
39+
System.out.println(connectorResponse);
4140
}
4241
}).build();
4342
}
@@ -49,7 +48,7 @@ GitHub getConnection() {
4948
try {
5049
connection = createNewConnection();
5150
} catch (IOException e) {
52-
e.printStackTrace();
51+
throw new RuntimeException(e);
5352
}
5453
}
5554
return connection;

0 commit comments

Comments
 (0)