@@ -6,6 +6,8 @@ package software.aws.toolkits.jetbrains.core.credentials
6
6
import com.intellij.openapi.progress.ProcessCanceledException
7
7
import com.intellij.openapi.project.Project
8
8
import com.intellij.openapi.vfs.VirtualFileManager
9
+ import org.slf4j.LoggerFactory
10
+ import org.slf4j.event.Level
9
11
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
10
12
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider
11
13
import software.amazon.awssdk.profiles.Profile
@@ -30,6 +32,8 @@ import software.aws.toolkits.telemetry.CredentialSourceId
30
32
import software.aws.toolkits.telemetry.Result
31
33
import java.io.IOException
32
34
35
+ private val LOG = LoggerFactory .getLogger(" LoginUtils" )
36
+
33
37
sealed interface Login {
34
38
val id: CredentialSourceId
35
39
@@ -58,12 +62,9 @@ sealed interface Login {
58
62
59
63
fun loginIdc (project : Project ): AwsBearerTokenConnection ? {
60
64
// we have this check here so we blow up early if user has an invalid config file
61
- try {
65
+ LOG .tryOrNull( " Failed to read sso sessions file " , level = Level . ERROR ) {
62
66
configFilesFacade.readSsoSessions()
63
- } catch (e: Exception ) {
64
- println (" Failed to read sso sessions file" )
65
- return null
66
- }
67
+ } ? : return null
67
68
68
69
val profile = UserConfigSsoSessionProfile (
69
70
configSessionName = validatedSsoIdentifierFromUrl(startUrl),
0 commit comments