Github: don't throw AuthentificationException on IOException

This commit is contained in:
Aleksey Pivovarov
2013-08-08 12:13:13 +04:00
parent a7ff79c23a
commit 4e44a6d003
2 changed files with 3 additions and 8 deletions
@@ -35,7 +35,8 @@ import git4idea.repo.GitRepository;
import git4idea.repo.GitRepositoryManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.github.api.*;
import org.jetbrains.plugins.github.api.GithubApiUtil;
import org.jetbrains.plugins.github.api.GithubUserDetailed;
import org.jetbrains.plugins.github.ui.GithubBasicLoginDialog;
import org.jetbrains.plugins.github.ui.GithubLoginDialog;
@@ -232,12 +233,7 @@ public class GithubUtil {
throw new GithubAuthenticationException("Anonymous connection not allowed");
}
try {
return testConnection(auth);
}
catch (JsonException e) {
throw new GithubAuthenticationException("Can't get user info", e);
}
return testConnection(auth);
}
@NotNull
@@ -207,7 +207,6 @@ public class GithubApiUtil {
case HttpStatus.SC_UNAUTHORIZED:
case HttpStatus.SC_PAYMENT_REQUIRED:
case HttpStatus.SC_FORBIDDEN:
case HttpStatus.SC_NOT_FOUND:
throw new GithubAuthenticationException("Request response: " + getErrorMessage(method));
default:
throw new HttpException(code + ": " + getErrorMessage(method));