You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
mdaneri
changed the title
Pode Listener write on console multiple [Error] HttpRequestException: Request timeout
HTTP Request Timeout Logs Unnecessary Errors to Console
Oct 26, 2024
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.The text was updated successfully, but these errors were encountered: