THRIFT-4609 keep InnerException wherever appropriate
Client: C#
Patch: Jens Geyer
This closes #1576
diff --git a/lib/csharp/src/Transport/TServerSocket.cs b/lib/csharp/src/Transport/TServerSocket.cs
index 40e47dc..d8ec62a 100644
--- a/lib/csharp/src/Transport/TServerSocket.cs
+++ b/lib/csharp/src/Transport/TServerSocket.cs
@@ -93,10 +93,10 @@
this.server = TSocketVersionizer.CreateTcpListener(this.port);
this.server.Server.NoDelay = true;
}
- catch (Exception)
+ catch (Exception ex)
{
server = null;
- throw new TTransportException("Could not create ServerSocket on port " + this.port + ".");
+ throw new TTransportException("Could not create ServerSocket on port " + this.port + ".", ex);
}
}
@@ -111,7 +111,7 @@
}
catch (SocketException sx)
{
- throw new TTransportException("Could not accept on listening socket: " + sx.Message);
+ throw new TTransportException("Could not accept on listening socket: " + sx.Message, sx);
}
}
}
@@ -153,7 +153,7 @@
}
catch (Exception ex)
{
- throw new TTransportException(ex.ToString());
+ throw new TTransportException(ex.ToString(), ex);
}
}
@@ -167,7 +167,7 @@
}
catch (Exception ex)
{
- throw new TTransportException("WARNING: Could not close server socket: " + ex);
+ throw new TTransportException("WARNING: Could not close server socket: " + ex, ex);
}
server = null;
}