Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous GSErrorCode missing from SDK #87

Open
1 task done
markst opened this issue Sep 3, 2024 · 1 comment
Open
1 task done

Previous GSErrorCode missing from SDK #87

markst opened this issue Sep 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@markst
Copy link

markst commented Sep 3, 2024

Checklist

Description

Prior to swift migration we had GSErrorCode which contained more granular details on what error occurred.

https://github.com/gigya/sample-ios-app/blob/4af1efca86e1d51c645ed3c270e64e43ffaaca29/GSSDK_2.15.6.iOS/GSResponse.h#L11

Reproduction

Example of gigyaError status code only containing unknown status code:

/// Since the loss of `GSErrorCode` all errors are treated as `unknown`
/// `403005`: _Unauthorized user -The user ID that is passed is not valid for this site._
/// `500026`: _Network error - Various network errors, e.g., when a JSONP request fails._
/// https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/416d41b170b21014bbc5a10ce4041860.html
if case .failure(let networkError) = result,
   case .gigyaError(let data) = networkError,
   data.statusCode == .unknown {

Additional context

No response

SDK version

1.6.3

@markst markst added the bug Something isn't working label Sep 3, 2024
@sagishm
Copy link
Member

sagishm commented Sep 3, 2024

Hi,
This is new sdk, nothing related to the old ObjC sdk, the only thing it saved is the session.
the .gigyaError contain all data you needs.

            case .failure(let error):
                switch error.error {
                case .gigyaError(data: let data):
                    // data object will contain all data related to error.
                   // you can use data.toDictionary() to get it as `Dictionary`.
                default:
                    break
                }
                print(error)
            }

at the end you needs to migrate your code to the new sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants