Description:
When an HTTP request times out in Pode, an error message is unnecessarily written to the console, even though the timeout is expected behavior. This results in a cluttered log output, making it harder to identify genuine issues.
Steps to Reproduce:
Trigger an HTTP request that will exceed the timeout threshold.
Observe the console/logs for error messages.
Expected Behavior:
Timeouts should not be logged as errors unless there is an unexpected issue related to the timeout.
Actual Behavior:
An error message appears on the console each time an HTTP request times out, despite this being an expected event.
Fix Implemented:
Modified the PodeSocket.HandleContext method to prevent logging HTTP request timeout errors:
if (context.CloseImmediately)
{
// Check if the error is not an HttpRequestException with a message starting with "Request timeout".
if (!(context.Request.Error is HttpRequestException httpRequestException) || !httpRequestException.Message.StartsWith("Request timeout"))
{
PodeHelpers.WriteException(context.Request.Error, Listener);
}
context.Dispose(true);
process = false;
}
The addition of the condition !httpRequestException.Message.StartsWith("Request timeout") ensures that only non-timeout-related exceptions are logged, reducing unnecessary console output.
Description: When an HTTP request times out in Pode, an error message is unnecessarily written to the console, even though the timeout is expected behavior. This results in a cluttered log output, making it harder to identify genuine issues.
Steps to Reproduce:
Expected Behavior: Timeouts should not be logged as errors unless there is an unexpected issue related to the timeout.
Actual Behavior: An error message appears on the console each time an HTTP request times out, despite this being an expected event.
Fix Implemented: Modified the
PodeSocket.HandleContext
method to prevent logging HTTP request timeout errors:The addition of the condition
!httpRequestException.Message.StartsWith("Request timeout")
ensures that only non-timeout-related exceptions are logged, reducing unnecessary console output.