Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-04-09 12:39:14 -0400
committerKevin Sawicki2012-04-09 12:39:14 -0400
commitf78deadf21d34eb0e7a60a6543d4f598cc962820 (patch)
tree0b949e3fa10c8495f17d189506633a8625382084
parent06364f73f94c17be716113679054ecab44ea4dfa (diff)
downloadegit-github-f78deadf21d34eb0e7a60a6543d4f598cc962820.tar.gz
egit-github-f78deadf21d34eb0e7a60a6543d4f598cc962820.tar.xz
egit-github-f78deadf21d34eb0e7a60a6543d4f598cc962820.zip
Set JsonParseException as cause of thrown IOException
Previously the message was just used and the cause exception discarded. Change-Id: I758d78efd8f506bc8f4a06970d8f9de36bc4bc52
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
index 89483ce7..b82fd33f 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/GitHubClient.java
@@ -379,7 +379,10 @@ public class GitHubClient {
try {
return gson.toJson(object);
} catch (JsonParseException jpe) {
- throw new IOException(jpe.getMessage());
+ IOException ioe = new IOException(
+ "Parse exception converting object to JSON"); //$NON-NLS-1$
+ ioe.initCause(jpe);
+ throw ioe;
}
}
@@ -398,7 +401,10 @@ public class GitHubClient {
try {
return gson.fromJson(reader, type);
} catch (JsonParseException jpe) {
- throw new IOException(jpe.getMessage());
+ IOException ioe = new IOException(
+ "Parse exception converting JSON to object"); //$NON-NLS-1$
+ ioe.initCause(jpe);
+ throw ioe;
} finally {
try {
reader.close();

Back to the top