diff options
author | 2017-06-01 21:56:24 +0200 | |
---|---|---|
committer | 2017-06-01 21:56:24 +0200 | |
commit | c4096469299bb9d417b7a3ebacea1dbfd31ed34f (patch) | |
tree | b13b4c6e31b6c0a71e0c203a2a98c3af12b9230e | |
parent | 67206428a41124abcde3798fa39728064ef59ff8 (diff) |
improve exception message
-rw-r--r-- | src/csharp/Grpc.Core/Server.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 7ba204a0b6..1fb5c62c8f 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -326,9 +326,11 @@ namespace Grpc.Core { lock (myLock) { - if (!ports.All((port) => port.BoundPort != 0)) + var unboundPort = ports.FirstOrDefault(port => port.BoundPort == 0); + if (unboundPort != null) { - throw new IOException("Failed to bind some of ports exposed by the server."); + throw new IOException( + string.Format("Failed to bind port \"{0}:{1}\"", unboundPort.Host, unboundPort.Port)); } } } |