Commit bf0a037d authored by Nick Craver's avatar Nick Craver

Fix TestQuit, by only exposing the wrapped exception from pipeline write failures

This is generally yhe behavior we want I think.
parent 34610f31
......@@ -270,8 +270,9 @@ public Task FlushAsync()
return Task.CompletedTask;
}
public void RecordConnectionFailed(ConnectionFailureType failureType, Exception innerException = null, [CallerMemberName] string origin = null)
public Exception RecordConnectionFailed(ConnectionFailureType failureType, Exception innerException = null, [CallerMemberName] string origin = null)
{
Exception ex = innerException;
IdentifyFailureType(innerException, ref failureType);
if (failureType == ConnectionFailureType.InternalFailure) OnInternalError(innerException, origin);
......@@ -330,7 +331,7 @@ void add(string lk, string sk, string v)
add("Last-Global-Heartbeat", "global", ConnectionMultiplexer.LastGlobalHeartbeatSecondsAgo + "s ago");
}
var ex = innerException == null
ex = innerException == null
? new RedisConnectionException(failureType, exMessage.ToString())
: new RedisConnectionException(failureType, exMessage.ToString(), innerException);
......@@ -357,6 +358,7 @@ void add(string lk, string sk, string v)
// burn the socket
Shutdown();
return ex;
}
public override string ToString()
......@@ -709,8 +711,7 @@ internal void WakeWriterAndCheckForThrottle()
}
catch (ConnectionResetException ex)
{
RecordConnectionFailed(ConnectionFailureType.SocketClosed, ex);
throw;
throw RecordConnectionFailed(ConnectionFailureType.SocketClosed, ex);
}
}
......
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