File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,26 @@ public class HTTPRequest<T: Decodable> {
6666 var request = self . request
6767
6868 do {
69+
70+ try Task . checkCancellation ( )
71+
6972 // Create the adapted request.
7073 request = try await ZipAdaptor ( adaptors) . adapt ( request, for: dispatcher. session)
7174
75+ try Task . checkCancellation ( )
76+
7277 // Dispatch the request and wait for a response.
7378 let ( data, response) = try await dispatcher. data ( for: request)
7479
80+ try Task . checkCancellation ( )
81+
7582 // Validate the response.
7683 try await ZipValidator ( validators)
7784 . validate ( response, for: request, with: data)
7885 . get ( )
7986
87+ try Task . checkCancellation ( )
88+
8089 // Convert data to the expected type
8190 return try decoder. decode ( T . self, from: data)
8291 } catch {
You canβt perform that action at this time.
0 commit comments