Closed
Description
SSH.NET 2025.0.0
SshException
("Failure") is about to happen as a result of SendRequest(request);
call. But by the time if (exception is not null)
check is done, the exception
variable is still null
(because it's set asynchronously after we get the response). So it won't be thrown by throw exception;
. That's the case if we just run after breaking on SendRequest(request);
line. But if we step over to the if (exception is not null)
line, the exception
variable gets a chance to be set, and we get that throw exception;
executed as it was intended.
This bug makes me unable to catch SshException
in my code while using sftpClient.UploadFile()
.
You can see demos in the GIFs below:
Metadata
Metadata
Assignees
Labels
No labels