@@ -5,23 +5,23 @@ public typealias Interceptor = RequestInterceptor & ResponseInterceptor
55
66/// a protocol intercepting a session request
77public protocol RequestInterceptor {
8- /// Should be called before making the request to provide modifications to `request`
9- func adaptRequest< Output> ( _ request: Request < Output > ) -> Request < Output >
10-
11- /// catch and retry a failed request
12- /// - Returns: nil if the request should not be retried. Otherwise a publisher that will be executed before
13- /// retrying the request
14- func rescueRequest< Output> ( _ request: Request < Output > , error: Error ) -> AnyPublisher < Void , Error > ?
8+ /// Should be called before making the request to provide modifications to `request`
9+ func adaptRequest< Output> ( _ request: Request < Output > ) -> Request < Output >
10+
11+ /// catch and retry a failed request
12+ /// - Returns: nil if the request should not be retried. Otherwise a publisher that will be executed before
13+ /// retrying the request
14+ func rescueRequest< Output> ( _ request: Request < Output > , error: Error ) -> AnyPublisher < Void , Error > ?
1515}
1616
1717/// a protocol intercepting a session response
1818public protocol ResponseInterceptor {
19- /// Should be called once the request is done and output was received. Let one last chance to modify the output
20- /// optionally throwing an error instead if needed
21- /// - Parameter request: the request that was sent to the server
22- func adaptOutput< Output> ( _ output: Output , for request: Request < Output > ) throws -> Output
23-
24- /// Notify of received response for `request`
25- /// - Parameter request: the request that was sent to the server
26- func receivedResponse< Output> ( _ result: Result < Output , Error > , for request: Request < Output > )
19+ /// Should be called once the request is done and output was received. Let one last chance to modify the output
20+ /// optionally throwing an error instead if needed
21+ /// - Parameter request: the request that was sent to the server
22+ func adaptOutput< Output> ( _ output: Output , for request: Request < Output > ) throws -> Output
23+
24+ /// Notify of received response for `request`
25+ /// - Parameter request: the request that was sent to the server
26+ func receivedResponse< Output> ( _ result: Result < Output , Error > , for request: Request < Output > )
2727}
0 commit comments