Skip to content

Commit

Permalink
Issue: #29
Browse files Browse the repository at this point in the history
Simplified the Exception handling in the ReaderThread.
  • Loading branch information
xforever1313 committed Feb 3, 2019
1 parent 78cbc44 commit 5a1a14c
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions Chaskis/ChaskisCore/IrcConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,24 +694,7 @@ private void ReaderThread()
}
}
}
catch( SocketException err )
{
StaticLogger.Log.WriteLine( "IRC Connection closed: " + err.Message );
if( this.KeepReading )
{
StaticLogger.Log.ErrorWriteLine(
"WARNING IRC connection closed, but we weren't terminating. Wait for watchdog to reconnect..."
);
return;
}
else
{
// We requested the irc connection be closed since KeepReading is false.
// Return, which will terminate this thread.
return;
}
}
catch( IOException err )
catch( Exception err )
{
StaticLogger.Log.WriteLine( "IRC Connection closed: " + err.Message );
if( this.KeepReading )
Expand All @@ -728,16 +711,6 @@ private void ReaderThread()
return;
}
}
catch( Exception err )
{
// Unexpected exception occurred. The connection probably dropped.
// Nothing we can do now except to wait for the watch dog to trigger a reconnect..
StaticLogger.Log.ErrorWriteLine(
"IRC Reader Thread caught unexpected exception:" + Environment.NewLine + err + Environment.NewLine + "Wait for watchdog to reconnect..."
);

return;
}
} // End While
}
catch( Exception err )
Expand Down

0 comments on commit 5a1a14c

Please sign in to comment.