@@ -110,24 +110,35 @@ class CoderLocateRemoteProjectStepView : CoderWorkspacesWizardStep, Disposable {
110
110
111
111
cs.launch {
112
112
logger.info(" Retrieving available IDE's for ${selectedWorkspace.name} workspace..." )
113
- val workspaceOS = withContext(Dispatchers .IO ) {
114
- RemoteCredentialsHolder ().apply {
115
- setHost(" coder.${selectedWorkspace.name} " )
116
- userName = " coder"
117
- authType = AuthType .OPEN_SSH
118
- }.guessOs
119
- }
120
- logger.info(" Resolved OS and Arch for ${selectedWorkspace.name} is: $workspaceOS " )
121
- val idesWithStatus = IntelliJPlatformProduct .values()
122
- .filter { it.showInGateway }
123
- .flatMap { CachingProductsJsonWrapper .getAvailableIdes(it, workspaceOS) }
124
- .map { ide -> IdeWithStatus (ide.product, ide.buildNumber, IdeStatus .DOWNLOAD , ide.downloadLink, ide.presentableVersion) }
125
-
126
- if (idesWithStatus.isEmpty()) {
127
- logger.warn(" Could not resolve any IDE for workspace ${selectedWorkspace.name} , probably $workspaceOS is not supported by Gateway" )
128
- } else {
129
- ideComboBoxModel.addAll(idesWithStatus)
130
- cbIDE.selectedIndex = 0
113
+ try {
114
+ val workspaceOS = withContext(Dispatchers .IO ) {
115
+ RemoteCredentialsHolder ().apply {
116
+ setHost(" coder.${selectedWorkspace.name} " )
117
+ userName = " coder"
118
+ authType = AuthType .OPEN_SSH
119
+ }.guessOs
120
+ }
121
+ logger.info(" Resolved OS and Arch for ${selectedWorkspace.name} is: $workspaceOS " )
122
+ val idesWithStatus = IntelliJPlatformProduct .values()
123
+ .filter { it.showInGateway }
124
+ .flatMap { CachingProductsJsonWrapper .getAvailableIdes(it, workspaceOS) }
125
+ .map { ide -> IdeWithStatus (ide.product, ide.buildNumber, IdeStatus .DOWNLOAD , ide.downloadLink, ide.presentableVersion) }
126
+
127
+ if (idesWithStatus.isEmpty()) {
128
+ logger.warn(" Could not resolve any IDE for workspace ${selectedWorkspace.name} , probably $workspaceOS is not supported by Gateway" )
129
+ } else {
130
+ ideComboBoxModel.addAll(idesWithStatus)
131
+ cbIDE.selectedIndex = 0
132
+ }
133
+ } catch (e: Exception ) {
134
+ logger.error(" Could not resolve any IDE for workspace ${selectedWorkspace.name} . Reason: $e " )
135
+ cbIDE.renderer = object : ColoredListCellRenderer <IdeWithStatus >() {
136
+ override fun customizeCellRenderer (list : JList <out IdeWithStatus >, value : IdeWithStatus ? , index : Int , isSelected : Boolean , cellHasFocus : Boolean ) {
137
+ background = UIUtil .getListBackground(isSelected, cellHasFocus)
138
+ icon = UIUtil .getBalloonErrorIcon()
139
+ append(CoderGatewayBundle .message(" gateway.connector.view.coder.remoteproject.ide.error.text" , selectedWorkspace.name))
140
+ }
141
+ }
131
142
}
132
143
}
133
144
}
0 commit comments