-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1341 from apollographql/explore/interceptors
Network Rearchitecture
- Loading branch information
Showing
64 changed files
with
2,807 additions
and
1,597 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Foundation | ||
|
||
/// An error interceptor called to allow further examination of error data when an error occurs in the chain. | ||
public protocol ApolloErrorInterceptor { | ||
|
||
/// Asynchronously handles the receipt of an error at any point in the chain. | ||
/// | ||
/// - Parameters: | ||
/// - error: The received error | ||
/// - chain: The chain the error was received on | ||
/// - request: The request, as far as it was constructed | ||
/// - response: [optional] The response, if one was received | ||
/// - completion: The completion closure to fire when the operation has completed. Note that if you call `retry` on the chain, you will not want to call the completion block in this method. | ||
func handleErrorAsync<Operation: GraphQLOperation>( | ||
error: Error, | ||
chain: RequestChain, | ||
request: HTTPRequest<Operation>, | ||
response: HTTPResponse<Operation>?, | ||
completion: @escaping (Result<GraphQLResult<Operation.Data>, Error>) -> Void) | ||
} |
Oops, something went wrong.