Skip to content

Commit

Permalink
Merge pull request #401
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Jan 13, 2018
2 parents e66f71c + a17ce04 commit 41c028d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
10 changes: 3 additions & 7 deletions src/main/java/org/kohsuke/github/GHGist.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public Map<String,GHGistFile> getFiles() {
* Used when caller obtains {@link GHGist} without knowing its owner.
* A partially constructed owner object is interned.
*/
/*package*/ GHGist wrapUp(GitHub root) throws IOException {
/*package*/ GHGist wrapUp(GitHub root) {
this.owner = root.getUser(owner);
this.root = root;
wrapUp();
Expand Down Expand Up @@ -144,12 +144,8 @@ public PagedIterator<GHGist> _iterator(int pageSize) {
return new PagedIterator<GHGist>(root.retrieve().asIterator(getApiTailUrl("forks"), GHGist[].class, pageSize)) {
@Override
protected void wrapUp(GHGist[] page) {
try {
for (GHGist c : page)
c.wrapUp(root);
} catch (IOException e) {
throw new Error(e);
}
for (GHGist c : page)
c.wrapUp(root);
}
};
}
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/org/kohsuke/github/Requester.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;

import static java.util.Arrays.*;
import static java.util.logging.Level.*;
import static org.apache.commons.lang.StringUtils.*;
import static org.kohsuke.github.GitHub.*;
import static java.util.Arrays.asList;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINEST;
import static java.util.logging.Level.INFO;
import static org.apache.commons.lang.StringUtils.defaultString;
import static org.kohsuke.github.GitHub.MAPPER;

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

Expand Down Expand Up @@ -513,7 +514,7 @@ private void fetch() {
}
}
} catch (IOException e) {
throw new Error(e);
throw new GHException("Failed to retrieve "+url);
}
}

Expand Down

0 comments on commit 41c028d

Please sign in to comment.