private void ClientStream_ErrorOccurred(object sender, Renci.SshNet.Common.ExceptionEventArgs e) { System.Diagnostics.Debug.WriteLine(e.Exception.Message); try { ClientStream.Close(); ClientStream.Dispose(); Client.Disconnect(); Client.Dispose(); } finally { ConnectionInfo = null; AuthenticationMethod = null; ClientStream = null; Client = null; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsConnected")); } }
async void client_ErrorOccurred(object sender, Renci.SshNet.Common.ExceptionEventArgs e) { try { throw e.Exception; } catch (SocketException exp) { await disconnect(); MainWindow.ShowMessage("Connection lost due to " + exp.SocketErrorCode + ": " + exp.Message, "Connection Error"); } catch (SshConnectionException ss_exp) { await disconnect(); MainWindow.ShowMessage("Connection issue due to " + ss_exp.DisconnectReason + ": " + ss_exp.Message, "Connection Error"); } catch (Exception ee) { await disconnect(); if (Debugger.IsAttached) { throw ee; } MainWindow.ShowMessage("unknown error let us know: " + ee.Message, "Unknown Error"); } }
private void Session_ErrorOccured(object sender, Common.ExceptionEventArgs e) { this.StopListener(); }
private void SshClient_ErrorOccurred(object sender, Renci.SshNet.Common.ExceptionEventArgs e) { Error(e.Exception); this.IsConnected = false; return; }