diff options
author | Kevin Sawicki | 2011-06-01 02:56:38 +0000 |
---|---|---|
committer | Kevin Sawicki | 2011-06-01 02:56:38 +0000 |
commit | 53ba2fc03caa5f465a44f5b021e47043bad5f785 (patch) | |
tree | 630ea9fd490cc9aa7afd6b966a72444dcbd8140c /org.eclipse.mylyn.github.ui | |
parent | 6d07419d4ee40ebddfcec53d34264a87e1fbe49b (diff) | |
download | egit-github-53ba2fc03caa5f465a44f5b021e47043bad5f785.tar.gz egit-github-53ba2fc03caa5f465a44f5b021e47043bad5f785.tar.xz egit-github-53ba2fc03caa5f465a44f5b021e47043bad5f785.zip |
Add support for error field in request error class.
The error field is present in v2 API error messages
which are still encountered when using the repository
API.
Change-Id: I8e4cffa4608696db056e7ee7b695da34061b103a
Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.ui')
-rw-r--r-- | org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java index 21d1d00a..63086552 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java @@ -33,6 +33,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.mylyn.internal.github.core.GitHub; +import org.eclipse.mylyn.internal.github.core.GitHubException; import org.eclipse.mylyn.internal.github.core.gist.GistConnector; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.TasksUi; @@ -231,15 +232,20 @@ public class RepositorySelectionWizardPage extends WizardPage { repoCount = repos.size(); updateInput(repos); } catch (IOException e) { - throw new InvocationTargetException(e); + throw new InvocationTargetException(GitHubException + .wrap(e)); } } }); + setErrorMessage(null); } catch (InvocationTargetException e) { updateInput(Collections.<Repository> emptyList()); + Throwable cause = e.getCause(); + if (cause == null) + cause = e; setErrorMessage(MessageFormat.format( - Messages.RepositorySelectionWizardPage_ErrorLoading, e - .getTargetException().getLocalizedMessage())); + Messages.RepositorySelectionWizardPage_ErrorLoading, + cause.getLocalizedMessage())); } catch (InterruptedException ignored) { // Ignored } |