Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 42b00d8

Browse files
committed
Use Error in connect|disconnect methods in AccountServiceRemoteREST
Instead of `NSError`. This way, we'll be able to pass the error to the `WordPressComRESTAPIInterfacing` version without needing to make any conversion. As far as I could see, the only consumer already worked in terms of `Error`. https://github.com/wordpress-mobile/WordPressAuthenticator-iOS/blob/30aada20beb9e0871f4da35a5634501536898b3b/WordPressAuthenticator/Services/WordPressComAccountService.swift#L31-L44
1 parent cbc5661 commit 42b00d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/WordPressKit/Services/AccountServiceRemoteREST+SocialService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension AccountServiceRemoteREST {
2323
oAuthClientID: String,
2424
oAuthClientSecret: String,
2525
success: @escaping (() -> Void),
26-
failure: @escaping ((NSError) -> Void)) {
26+
failure: @escaping ((Error) -> Void)) {
2727
let path = self.path(forEndpoint: "me/social-login/connect", withVersion: ._1_1)
2828

2929
var params = [
@@ -65,7 +65,7 @@ extension AccountServiceRemoteREST {
6565
/// - oAuthClientSecret The WPCOM REST API client secret.
6666
/// - success The block that will be executed on success.
6767
/// - failure The block that will be executed on failure.
68-
public func disconnectFromSocialService(_ service: SocialServiceName, oAuthClientID: String, oAuthClientSecret: String, success: @escaping(() -> Void), failure: @escaping((NSError) -> Void)) {
68+
public func disconnectFromSocialService(_ service: SocialServiceName, oAuthClientID: String, oAuthClientSecret: String, success: @escaping(() -> Void), failure: @escaping((Error) -> Void)) {
6969
let path = self.path(forEndpoint: "me/social-login/disconnect", withVersion: ._1_1)
7070
let params = [
7171
"client_id": oAuthClientID,

0 commit comments

Comments
 (0)