mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Github: don't throw AuthentificationException on IOException
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user