diff --git a/.circleci/config.yml b/.circleci/config.yml index 5271235e..26f26be2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,8 +3,8 @@ version: 2.1 # Default VM config to be used for macOS builds macos_config: &macos_config macos: - xcode: 16.0.0 - resource_class: macos.m1.large.gen1 + xcode: 26.2.0 + resource_class: m4pro.medium shell: /bin/bash --login -eo pipefail setup_env_file: &setup_env_file diff --git a/ios/IntercomModule.m b/ios/IntercomModule.m index af690ed3..618fe797 100644 --- a/ios/IntercomModule.m +++ b/ios/IntercomModule.m @@ -152,7 +152,29 @@ - (NSData *)dataFromHexString:(NSString *)string { [Intercom updateUser:userAttributes success:^{ resolve(@(YES)); } failure:^(NSError * _Nonnull error) { - failureCallback(UPDATE_USER, @"Error in updateUser", [self removeNullUnderlyingError:error]); + NSString *errorMessage = [NSString stringWithFormat:@"updateUser failed with error code %ld: %@. Domain: %@", + (long)error.code, + error.localizedDescription ?: @"", + error.domain ?: @""]; + + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:error.userInfo ?: @{}]; + userInfo[@"detailedMessage"] = errorMessage; + userInfo[@"errorCode"] = @(error.code); + userInfo[@"errorDomain"] = error.domain ?: @""; + + if (error.userInfo[@"NSUnderlyingError"]) { + NSError *underlyingError = error.userInfo[@"NSUnderlyingError"]; + if (![underlyingError isKindOfClass:[NSNull class]]) { + userInfo[@"underlyingErrorDescription"] = underlyingError.localizedDescription ?: @""; + userInfo[@"underlyingErrorCode"] = @(underlyingError.code); + } + } + + NSError *enrichedError = [NSError errorWithDomain:error.domain + code:error.code + userInfo:userInfo]; + + failureCallback(UPDATE_USER, errorMessage, [self removeNullUnderlyingError:enrichedError]); }]; };