mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
github: GithubCredentialsUI: cleanup formatting
GitOrigin-RevId: 66645a67a901d1e038b43076d4ed9759fe218844
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1bab0338d9
commit
75a403ec13
+7
-15
@@ -98,13 +98,10 @@ sealed class GithubCredentialsUI {
|
||||
|
||||
override fun handleAcquireError(error: Throwable): ValidationInfo {
|
||||
return when (error) {
|
||||
is LoginNotUniqueException -> ValidationInfo(
|
||||
"Account already added", loginTextField).withOKEnabled()
|
||||
is LoginNotUniqueException -> ValidationInfo("Account already added", loginTextField).withOKEnabled()
|
||||
is UnknownHostException -> ValidationInfo("Server is unreachable").withOKEnabled()
|
||||
is GithubAuthenticationException -> ValidationInfo(
|
||||
"Incorrect credentials. ${error.message.orEmpty()}").withOKEnabled()
|
||||
is GithubParseException -> ValidationInfo(
|
||||
error.message ?: "Invalid server path", serverTextField)
|
||||
is GithubAuthenticationException -> ValidationInfo("Incorrect credentials. ${error.message.orEmpty()}").withOKEnabled()
|
||||
is GithubParseException -> ValidationInfo(error.message ?: "Invalid server path", serverTextField)
|
||||
else -> ValidationInfo("Invalid authentication data.\n ${error.message}").withOKEnabled()
|
||||
}
|
||||
}
|
||||
@@ -151,9 +148,7 @@ sealed class GithubCredentialsUI {
|
||||
DialogValidationUtils.notBlank(tokenTextField, "Token cannot be empty")
|
||||
}
|
||||
|
||||
override fun createExecutor(): GithubApiRequestExecutor {
|
||||
return factory.create(tokenTextField.text)
|
||||
}
|
||||
override fun createExecutor() = factory.create(tokenTextField.text)
|
||||
|
||||
override fun acquireLoginAndToken(server: GithubServerPath,
|
||||
executor: GithubApiRequestExecutor,
|
||||
@@ -185,13 +180,10 @@ sealed class GithubCredentialsUI {
|
||||
|
||||
override fun handleAcquireError(error: Throwable): ValidationInfo {
|
||||
return when (error) {
|
||||
is LoginNotUniqueException -> ValidationInfo(
|
||||
"Account ${error.login} already added").withOKEnabled()
|
||||
is LoginNotUniqueException -> ValidationInfo("Account ${error.login} already added").withOKEnabled()
|
||||
is UnknownHostException -> ValidationInfo("Server is unreachable").withOKEnabled()
|
||||
is GithubAuthenticationException -> ValidationInfo(
|
||||
"Incorrect credentials. ${error.message.orEmpty()}").withOKEnabled()
|
||||
is GithubParseException -> ValidationInfo(
|
||||
error.message ?: "Invalid server path", serverTextField)
|
||||
is GithubAuthenticationException -> ValidationInfo("Incorrect credentials. ${error.message.orEmpty()}").withOKEnabled()
|
||||
is GithubParseException -> ValidationInfo(error.message ?: "Invalid server path", serverTextField)
|
||||
else -> ValidationInfo("Invalid authentication data.\n ${error.message}").withOKEnabled()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user