Skip to content

Commit 37131fd

Browse files
committed
wording corrected
1 parent 4b10bfa commit 37131fd

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/main/kotlin/com/vk/admstorm/ssh/SshConnectionService.kt

+11-14
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,9 @@ class SshConnectionService(private var myProject: Project) : Disposable {
153153
onSuccessful?.run()
154154
}
155155
} 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 " +
158158
code("ssh-agent")
159-
}"
160159

161160
AdmErrorNotification(message, true)
162161
.withTitle("Failed to connect to server")
@@ -195,15 +194,13 @@ class SshConnectionService(private var myProject: Project) : Disposable {
195194
LOG.info("Yubikey waiting timeout", ex)
196195
} catch (ex: TransportException) {
197196
if (ex.message == null) {
198-
LOG.error("Transport exception: ${ex.javaClass.name}")
197+
LOG.error("Transport exception:", ex.javaClass.name)
199198
return
200199
}
201200

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?")
207204
.withActions(AdmNotification.Action("Reconnect...") { _, notification ->
208205
notification.expire()
209206
connectWithConnector(connector, onSuccessful)
@@ -212,17 +209,17 @@ class SshConnectionService(private var myProject: Project) : Disposable {
212209
return
213210
}
214211

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?")
217214
.withActions(AdmNotification.Action("Reconnect...") { _, notification ->
218215
notification.expire()
219216
connectWithConnector(connector, onSuccessful)
220217
}).show()
221218
LOG.info("Corporate access error", ex)
222219
} 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()
226223
return
227224
}
228225
}

src/main/kotlin/com/vk/admstorm/utils/MySshUtils.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ object MySshUtils {
102102
handleSshException(project, ex)
103103
null
104104
} catch (ex: Exception) {
105-
val message = ex.javaClass.name
106-
LOG.error("Unhandled exception $message: ${ex.message}")
107-
AdmErrorNotification("Unhandled exception $message").show()
105+
val exceptionName = ex.javaClass.name
106+
LOG.error("Unhandled exception", ex)
107+
AdmErrorNotification("Unhandled exception $exceptionName").show()
108108
null
109109
} ?: return null
110110

0 commit comments

Comments
 (0)