Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d0b4652

Browse filesBrowse files
bjoernhaeuserkohsuke
authored andcommitted
Replace "new Error" with GHException
(rolled back some of the hunks from the original PR)
1 parent e25ae27 commit d0b4652
Copy full SHA for d0b4652

File tree

Expand file treeCollapse file tree

2 files changed

+12
-15
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-15
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHGist.java
+3-7Lines 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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/Requester.java
+9-8Lines changed: 9 additions & 8 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.
@@ -451,8 +452,8 @@ private boolean isMethodWithBody() {
451452

452453
try {
453454
return new PagingIterator<T>(type, tailApiUrl, root.getApiURL(s.toString()));
454-
} catch (IOException e) {
455-
throw new Error(e);
455+
} catch (MalformedURLException 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(e);
517518
}
518519
}
519520

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.