Github: show message on exception

This commit is contained in:
Aleksey Pivovarov
2013-08-21 17:21:06 +04:00
parent 0a63cd4a97
commit 99f3a666b1
@@ -18,6 +18,9 @@ import icons.TasksIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.github.api.GithubApiUtil;
import org.jetbrains.plugins.github.exceptions.GithubAuthenticationException;
import org.jetbrains.plugins.github.exceptions.GithubJsonException;
import org.jetbrains.plugins.github.exceptions.GithubStatusCodeException;
import org.jetbrains.plugins.github.util.GithubAuthData;
import org.jetbrains.plugins.github.util.GithubUtil;
import org.jetbrains.plugins.github.api.GithubIssue;
@@ -81,7 +84,18 @@ public class GithubRepository extends BaseRepositoryImpl {
@Override
public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
return getIssues(query);
try {
return getIssues(query);
}
catch (GithubAuthenticationException e) {
throw new Exception(e.getMessage(), e);
}
catch (GithubStatusCodeException e) {
throw new Exception(e.getMessage(), e);
}
catch (GithubJsonException e) {
throw new Exception("Bad response format", e);
}
}
@NotNull