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