@@ -38,6 +38,7 @@ import software.aws.toolkits.jetbrains.core.credentials.sono.SONO_URL
38
38
import software.aws.toolkits.jetbrains.core.help.HelpIds
39
39
import software.aws.toolkits.resources.message
40
40
import software.aws.toolkits.telemetry.UiTelemetry
41
+ import java.io.IOException
41
42
import javax.swing.JComponent
42
43
43
44
data class ConnectionDialogCustomizer (
@@ -117,7 +118,7 @@ open class ToolkitAddConnectionDialog(
117
118
try {
118
119
// Edge case when user choose SSO but enter AWS Builder ID url
119
120
if (loginType == LoginOptions .SSO && startUrl == SONO_URL ) {
120
- error(" User should not do SSO login with AWS Builder ID url" )
121
+ error(" User should not perform Identity Center login with AWS Builder ID url" )
121
122
}
122
123
123
124
val scopes = if (loginType == LoginOptions .AWS_BUILDER_ID ) {
@@ -133,11 +134,19 @@ open class ToolkitAddConnectionDialog(
133
134
}
134
135
} catch (e: Exception ) {
135
136
val message = when (e) {
137
+ is IllegalStateException -> e.message ? : message(" general.unknown_error" )
136
138
is ProcessCanceledException -> message(" codewhisperer.credential.login.dialog.exception.cancel_login" )
137
139
is InvalidGrantException -> message(" codewhisperer.credential.login.exception.invalid_grant" )
138
140
is InvalidRequestException -> message(" codewhisperer.credential.login.exception.invalid_input" )
139
141
is SsoOidcException -> message(" codewhisperer.credential.login.exception.general.oidc" )
140
- else -> message(" codewhisperer.credential.login.exception.general" )
142
+ else -> {
143
+ val baseMessage = when (e) {
144
+ is IOException -> " codewhisperer.credential.login.exception.io"
145
+ else -> " codewhisperer.credential.login.exception.general"
146
+ }
147
+
148
+ message(baseMessage, " ${e.javaClass.name} : ${e.message} " )
149
+ }
141
150
}
142
151
LOG .warn(e) { message }
143
152
setErrorText(message)
0 commit comments