Skip to content

Commit 41c028d

Browse files
committed
Merge pull request hub4j#401
2 parents e66f71c + a17ce04 commit 41c028d

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

src/main/java/org/kohsuke/github/GHGist.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public Map<String,GHGistFile> getFiles() {
103103
* Used when caller obtains {@link GHGist} without knowing its owner.
104104
* A partially constructed owner object is interned.
105105
*/
106-
/*package*/ GHGist wrapUp(GitHub root) throws IOException {
106+
/*package*/ GHGist wrapUp(GitHub root) {
107107
this.owner = root.getUser(owner);
108108
this.root = root;
109109
wrapUp();
@@ -144,12 +144,8 @@ public PagedIterator<GHGist> _iterator(int pageSize) {
144144
return new PagedIterator<GHGist>(root.retrieve().asIterator(getApiTailUrl("forks"), GHGist[].class, pageSize)) {
145145
@Override
146146
protected void wrapUp(GHGist[] page) {
147-
try {
148-
for (GHGist c : page)
149-
c.wrapUp(root);
150-
} catch (IOException e) {
151-
throw new Error(e);
152-
}
147+
for (GHGist c : page)
148+
c.wrapUp(root);
153149
}
154150
};
155151
}

src/main/java/org/kohsuke/github/Requester.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,17 @@
5454
import java.util.Locale;
5555
import java.util.Map;
5656
import java.util.NoSuchElementException;
57-
import java.util.logging.Level;
5857
import java.util.logging.Logger;
5958
import java.util.regex.Matcher;
6059
import java.util.regex.Pattern;
6160
import java.util.zip.GZIPInputStream;
6261

63-
import static java.util.Arrays.*;
64-
import static java.util.logging.Level.*;
65-
import static org.apache.commons.lang.StringUtils.*;
66-
import static org.kohsuke.github.GitHub.*;
62+
import static java.util.Arrays.asList;
63+
import static java.util.logging.Level.FINE;
64+
import static java.util.logging.Level.FINEST;
65+
import static java.util.logging.Level.INFO;
66+
import static org.apache.commons.lang.StringUtils.defaultString;
67+
import static org.kohsuke.github.GitHub.MAPPER;
6768

6869
/**
6970
* A builder pattern for making HTTP call and parsing its output.
@@ -452,7 +453,7 @@ private boolean isMethodWithBody() {
452453
try {
453454
return new PagingIterator<T>(type, tailApiUrl, root.getApiURL(s.toString()));
454455
} catch (IOException e) {
455-
throw new Error(e);
456+
throw new GHException("Unable to build github Api URL",e);
456457
}
457458
}
458459

@@ -513,7 +514,7 @@ private void fetch() {
513514
}
514515
}
515516
} catch (IOException e) {
516-
throw new Error(e);
517+
throw new GHException("Failed to retrieve "+url);
517518
}
518519
}
519520

0 commit comments

Comments
 (0)