Always send lowlevel_error response to client (#2731)#2
Open
MitchLewis930 wants to merge 1 commit intopr_052_beforefrom
Open
Always send lowlevel_error response to client (#2731)#2MitchLewis930 wants to merge 1 commit intopr_052_beforefrom
MitchLewis930 wants to merge 1 commit intopr_052_beforefrom
Conversation
* Always send lowlevel_error response to client * Add spec for lowlever error handler * Make sure we have a clean buffer when starting response * Simplify test * Rename spec * Add method docs * Tweak the test * Return 500 from lowlevel_error_handler in test Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
Greptile OverviewGreptile SummaryRefactored error response handling to ensure
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Server
participant Request
participant App
Client->>Server: HTTP Request
Server->>Server: process_client()
Server->>Request: handle_request()
alt Normal Flow
Request->>App: @app.call(env)
App-->>Request: [status, headers, body]
Request->>Request: write_response()
Request->>Client: HTTP Response
else ThreadPool::ForceShutdown
Request->>Request: lowlevel_error(503)
Request->>Request: write_response()
Request->>Client: 503 Error Response
else Exception in App
Request->>Request: lowlevel_error(500)
Request->>Request: write_response()
Request->>Client: 500 Error Response
else Client I/O Error (HttpParserError)
Server->>Server: client_error()
Server->>Server: lowlevel_error(400)
Server->>Request: write_response()
Request->>Client: 400 Error Response
else Client I/O Error (Other)
Server->>Server: client_error()
Server->>Server: lowlevel_error(500)
Server->>Request: write_response()
Request->>Client: 500 Error Response
end
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR_052