Commit 925ea47d authored by Marc Gravell's avatar Marc Gravell

Merge branch 'master' of git@github.com:StackExchange/StackExchange.Redis.git

parents a335a78a 6fc43b6f
......@@ -662,7 +662,7 @@ public static async Task<ConnectionMultiplexer> ConnectAsync(string configuratio
bool configured = await muxer.ReconfigureAsync(true, false, log, null, "connect").ObserveErrors().ForAwait();
if (!configured)
{
throw ExceptionFactory.UnableToConnect();
throw ExceptionFactory.UnableToConnect(muxer.failureMessage);
}
killMe = null;
return muxer;
......@@ -685,7 +685,7 @@ public static async Task<ConnectionMultiplexer> ConnectAsync(ConfigurationOption
bool configured = await muxer.ReconfigureAsync(true, false, log, null, "connect").ObserveErrors().ForAwait();
if (!configured)
{
throw ExceptionFactory.UnableToConnect();
throw ExceptionFactory.UnableToConnect(muxer.failureMessage);
}
killMe = null;
return muxer;
......@@ -733,7 +733,7 @@ public static ConnectionMultiplexer Connect(string configuration, TextWriter log
throw new TimeoutException();
}
}
if(!task.Result) throw ExceptionFactory.UnableToConnect();
if(!task.Result) throw ExceptionFactory.UnableToConnect(muxer.failureMessage);
killMe = null;
return muxer;
}
......@@ -762,7 +762,7 @@ public static ConnectionMultiplexer Connect(ConfigurationOptions configuration,
throw new TimeoutException();
}
}
if(!task.Result) throw ExceptionFactory.UnableToConnect();
if (!task.Result) throw ExceptionFactory.UnableToConnect(muxer.failureMessage);
killMe = null;
return muxer;
}
......@@ -772,6 +772,7 @@ public static ConnectionMultiplexer Connect(ConfigurationOptions configuration,
}
}
private string failureMessage;
private readonly Hashtable servers = new Hashtable();
private volatile ServerEndPoint[] serverSnapshot = NilServers;
......@@ -1183,6 +1184,7 @@ internal async Task<bool> ReconfigureAsync(bool first, bool reconfigureAll, Text
foreach (var ex in aex.InnerExceptions)
{
LogLocked(log, "{0} faulted: {1}", Format.ToString(endpoints[i]), ex.Message);
failureMessage = ex.Message;
}
}
else if (task.IsCanceled)
......
......@@ -106,10 +106,10 @@ static string GetLabel(bool includeDetail, RedisCommand command, Message message
return message == null ? command.ToString() : (includeDetail ? message.CommandAndKey : message.Command.ToString());
}
internal static Exception UnableToConnect()
internal static Exception UnableToConnect(string failureMessage=null)
{
return new RedisConnectionException(ConnectionFailureType.UnableToConnect,
"It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail");
"It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. " + failureMessage);
}
}
}
......@@ -60,6 +60,17 @@ public bool IsNullOrEmpty
}
}
/// <summary>
/// Indicates whether the value is greater than zero-length
/// </summary>
public bool HasValue
{
get
{
return valueBlob != null && valueBlob.Length > 0;
}
}
/// <summary>
/// Indicates whether two RedisValue values are equivalent
/// </summary>
......
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