Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 23 additions & 1 deletion ios/IntercomModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?: @"<no description>",
error.domain ?: @"<no 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]);
}];
};

Expand Down