Skip to content

Commit 15cd6fa

Browse files
authored
docs(service): add note about error handling in Service trait (#3659) (#3712)
The Service trait now includes a note about the behavior of returning an Error to a hyper server, which can cause the connection to be abruptly aborted depending on the protocol. This information is important for developers working with hyper servers.
1 parent 5a13041 commit 15cd6fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/service/service.rs

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ pub trait Service<Request> {
2222
type Response;
2323

2424
/// Errors produced by the service.
25+
///
26+
/// Note: Returning an `Error` to a hyper server, the behavior depends on the
27+
/// protocol. In most cases, hyper will cause the connection to be abruptly aborted.
28+
/// It will abort the request however the protocol allows, either with some sort of RST_STREAM,
29+
/// or killing the connection if that doesn't exist.
2530
type Error;
2631

2732
/// The future response value.

0 commit comments

Comments
 (0)