mongodb / stitch-ios-sdk

Apache License 2.0
42 stars 25 forks source link

bad error description via StitchError #207

Open ahmetfg opened 4 years ago

ahmetfg commented 4 years ago

I am trying to do a simple authentication with stitch

stitch.auth.login(withCredential: credential) { (result) in
    DispatchQueue.main.async {
        switch result{
        case .success(_):
            // do this do that
        case .failure(let error):
            print(error.localizedDescription)
        }
    }
}

When it catches an error, printing the description like this:

"{\"error\":\"invalid username/password\",\"error_code\":\"AuthError\",\"link\":\"https://stitch.mongodb.com/groups/5e7fc699dd44dc2defcea290/apps/5e8604a2b739bee98977ff72/logs?co_id=5e8b546f2586fedc42348d64\"}"

I think the proper description should look like this:

invalid username/password

I know the error is a json object but its an enum that have associated value. I cant get the error json directly.

Maybe its about my sdk version but I cant update the pod either. Your repository giving this error:

[!] CocoaPods could not find compatible versions for pod "StitchSDK": In Podfile: StitchSDK (~> 6.4.0)

my setup:

Xcode: 11 stitch sdk v: 6.1.0