Commit 8b4d2ce2 authored by Marc Gravell's avatar Marc Gravell

include and log the received message when when do an OnMessageFaulted from SetResult

parent aaade660
......@@ -266,7 +266,14 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
}
muxer.InternalError += OnInternalError;
muxer.ConnectionFailed += OnConnectionFailed;
muxer.MessageFaulted += (msg, ex, origin) => Writer?.WriteLine($"Faulted from '{origin}': '{msg}' - '{(ex == null ? "(null)" : ex.Message)}'");
muxer.MessageFaulted += (msg, ex, origin) =>
{
Writer?.WriteLine($"Faulted from '{origin}': '{msg}' - '{(ex == null ? "(null)" : ex.Message)}'");
if (ex.Data.Contains("got"))
{
Writer?.WriteLine($"Got: '{ex.Data["got"]}'");
}
};
muxer.Connecting += (e, t) => Writer.WriteLine($"Connecting to {Format.ToString(e)} as {t}");
muxer.TransactionLog += msg => { lock (Writer) { Writer.WriteLine("tran: " + msg); } };
muxer.Resurrecting += (e, t) => Writer.WriteLine($"Resurrecting {Format.ToString(e)} as {t}");
......
......@@ -592,6 +592,7 @@ internal bool ComputeResult(PhysicalConnection connection, RawResult result)
}
catch (Exception ex)
{
ex.Data.Add("got", result.ToString());
connection?.BridgeCouldBeNull?.Multiplexer?.OnMessageFaulted(this, ex);
box?.SetException(ex);
return box != null; // we still want to pulse/complete
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment