Skip to content

Commit

Permalink
Add more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorsington committed Sep 1, 2018
1 parent 479b4af commit b1e9be1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Core/COM3D2.MaidFiddler.Plugin/IPC/PipeEventEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void AddEvent(string name, Dictionary<string, object> args)

public void Disconnect()
{
Debugger.Debug(LogLevel.Info, "EventEmitter: Disconnecting!");
pipeStream.Disconnect();
IsConnected = false;
}
Expand All @@ -110,7 +111,8 @@ public void EmitEvents()
}
catch (EndOfStreamException e)
{
Debugger.Debug(LogLevel.Info, "EventEmitter: Connection closed on event emmitter!");
Debugger.Debug(LogLevel.Info, "EventEmitter: Connection closed on event emitter!");
Debugger.Debug(LogLevel.Info, $"Inner exception (harmless): {e.Message}");
pipeStream.Disconnect();
IsConnected = false;
ConnectionLost?.Invoke(null, EventArgs.Empty);
Expand Down
5 changes: 4 additions & 1 deletion Core/COM3D2.MaidFiddler.Plugin/IPC/PipeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ private void RunInternal()
{
pipeStream.WaitForConnection();
}
catch (Exception)
catch (Exception e)
{
Debugger.WriteLine(LogLevel.Info, "PipeService: Aborting waiting!");
Debugger.WriteLine(LogLevel.Info, $"Inner error (harmless): {e.Message}");
((IDisposable) bw).Dispose();
((IDisposable) br).Dispose();
return;
Expand Down Expand Up @@ -218,6 +219,8 @@ private void RunInternal()
}
catch (EndOfStreamException e)
{
Debugger.Debug(LogLevel.Info, "PipeService: Connection lost! Resetting!");
Debugger.Debug(LogLevel.Info, $"Inner error (harmless): {e.Message}");
pipeStream.Flush();
pipeStream.Disconnect();
IsConnected = false;
Expand Down

0 comments on commit b1e9be1

Please sign in to comment.