Skip to content

Commit dcc596a

Browse files
IgorMilavecWojciechNagorskiRob-Hague
authored
Use ExceptionDispatchInfo to retain call stack in Session.WaitOnHandle() (#936)
* Use ExceptionDispatchInfo to retain call stack in Session.WaitOnHandle() * merge * Update src/Renci.SshNet/Session.cs Co-authored-by: Rob Hague <[email protected]> --------- Co-authored-by: Wojciech Nagórski <[email protected]> Co-authored-by: Rob Hague <[email protected]>
1 parent 60de8a4 commit dcc596a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Renci.SshNet/Session.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ internal void WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
992992
switch (signaledElement)
993993
{
994994
case 0:
995-
throw _exception;
995+
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(_exception).Throw();
996+
break;
996997
case 1:
997998
throw new SshConnectionException("Client not connected.");
998999
case 2:

0 commit comments

Comments
 (0)