THRIFT-4609 keep InnerException wherever appropriate
Client: C#
Patch: Jens Geyer
This closes #1576
diff --git a/lib/csharp/src/Transport/THttpClient.cs b/lib/csharp/src/Transport/THttpClient.cs
index 06ed6bc..667fc25 100644
--- a/lib/csharp/src/Transport/THttpClient.cs
+++ b/lib/csharp/src/Transport/THttpClient.cs
@@ -139,7 +139,7 @@
}
catch (IOException iox)
{
- throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
+ throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString(), iox);
}
}
@@ -217,11 +217,11 @@
}
catch (IOException iox)
{
- throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString());
+ throw new TTransportException(TTransportException.ExceptionType.Unknown, iox.ToString(), iox);
}
catch (WebException wx)
{
- throw new TTransportException(TTransportException.ExceptionType.Unknown, "Couldn't connect to server: " + wx);
+ throw new TTransportException(TTransportException.ExceptionType.Unknown, "Couldn't connect to server: " + wx, wx);
}
}
@@ -316,7 +316,7 @@
}
catch (IOException iox)
{
- throw new TTransportException(iox.ToString());
+ throw new TTransportException(iox.ToString(), iox);
}
}
@@ -360,7 +360,7 @@
}
catch (Exception exception)
{
- flushAsyncResult.AsyncException = new TTransportException(exception.ToString());
+ flushAsyncResult.AsyncException = new TTransportException(exception.ToString(), exception);
flushAsyncResult.UpdateStatusToComplete();
flushAsyncResult.NotifyCallbackWhenAvailable();
}
@@ -375,7 +375,7 @@
}
catch (Exception exception)
{
- flushAsyncResult.AsyncException = new TTransportException(exception.ToString());
+ flushAsyncResult.AsyncException = new TTransportException(exception.ToString(), exception);
}
flushAsyncResult.UpdateStatusToComplete();
flushAsyncResult.NotifyCallbackWhenAvailable();