@@ -153,10 +153,9 @@ class SshConnectionService(private var myProject: Project) : Disposable {
153
153
onSuccessful?.run ()
154
154
}
155
155
} catch (ex: OpenFailException ) {
156
- val message =
157
- " ${ex.message} <br> Plugin can try to automatically reset the Yubikey or you can do it yourself with ${
156
+ val message = " ${ex.message} <br> " +
157
+ " Plugin can try to automatically reset the Yubikey or you can do it yourself with " +
158
158
code(" ssh-agent" )
159
- } "
160
159
161
160
AdmErrorNotification (message, true )
162
161
.withTitle(" Failed to connect to server" )
@@ -195,15 +194,13 @@ class SshConnectionService(private var myProject: Project) : Disposable {
195
194
LOG .info(" Yubikey waiting timeout" , ex)
196
195
} catch (ex: TransportException ) {
197
196
if (ex.message == null ) {
198
- LOG .error(" Transport exception: ${ ex.javaClass.name} " )
197
+ LOG .error(" Transport exception:" , ex.javaClass.name)
199
198
return
200
199
}
201
200
202
- val message =
203
- " ${ex.javaClass.name} : ${ex.message} "
204
- if (ex.message!! .contains(" HostKeyAlgorithms" )) {
205
- AdmErrorNotification (message, true )
206
- .withTitle(" Did you switch your SSH config type to LEGACY?" )
201
+ if (ex.message?.contains(" HostKeyAlgorithms" ) == true ) {
202
+ AdmErrorNotification (" Recheck your config or the documentation" , true )
203
+ .withTitle(" Did you add HostKeyAlgorithms to your config?" )
207
204
.withActions(AdmNotification .Action (" Reconnect..." ) { _, notification ->
208
205
notification.expire()
209
206
connectWithConnector(connector, onSuccessful)
@@ -212,17 +209,17 @@ class SshConnectionService(private var myProject: Project) : Disposable {
212
209
return
213
210
}
214
211
215
- AdmErrorNotification (message , true )
216
- .withTitle(" Did you connect to corporate access system ?" )
212
+ AdmErrorNotification (" Check the documentation about connection to network " , true )
213
+ .withTitle(" Did you miss your connection ?" )
217
214
.withActions(AdmNotification .Action (" Reconnect..." ) { _, notification ->
218
215
notification.expire()
219
216
connectWithConnector(connector, onSuccessful)
220
217
}).show()
221
218
LOG .info(" Corporate access error" , ex)
222
219
} catch (ex: Exception ) {
223
- val message = ex.javaClass.name
224
- LOG .error(" Unhandled exception $message : ${ex.message} " )
225
- AdmErrorNotification (" Unhandled exception $message " ).show()
220
+ val exceptionName = ex.javaClass.name
221
+ LOG .error(" Unhandled exception" , ex )
222
+ AdmErrorNotification (" Unhandled exception $exceptionName " ).show()
226
223
return
227
224
}
228
225
}
0 commit comments