Improve exception diagnostics for stdio client (#376)

* Improve exception diagnostics for stdio client

Track the last several lines of stderr and include those in an exception created as part of CleanupAsync if the server process has already exited. This is based on an assumption that the server should never exit prior to CleanupAsync being called.

* Address feedback and fix test failure
This commit is contained in:
Stephen Toub 2025-05-14 10:46:49 -04:00 • committed by GitHub
commit c11c634945
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,7 +137,7 @@ internal sealed partial class SseClientSessionTransport : TransportBase
}
finally
{
SetConnected(false);
SetDisconnected();
}
}
@ -203,7 +203,7 @@ internal sealed partial class SseClientSessionTransport : TransportBase
}
finally
{
SetConnected(false);
SetDisconnected();
}
}
@ -251,7 +251,7 @@ internal sealed partial class SseClientSessionTransport : TransportBase
_messageEndpoint = new Uri(_sseEndpoint, data);
// Set connected state
SetConnected(true);
SetConnected();
_connectionEstablished.TrySetResult(true);
}