Closed jesperjohansson closed 1 year ago
On iOS you always receive the error message "error in connect() function". By switching to localizedDescription we could get more specific error messages such as "Connection refused".
localizedDescription
patch-package:
diff --git a/node_modules/react-native-tcp-socket/ios/TcpSockets.m b/node_modules/react-native-tcp-socket/ios/TcpSockets.m index 23c961f..3a9783a 100644 --- a/node_modules/react-native-tcp-socket/ios/TcpSockets.m +++ b/node_modules/react-native-tcp-socket/ios/TcpSockets.m @@ -283,7 +283,7 @@ - (void)onClose:(NSNumber *)clientID withError:(NSError *)err { } - (void)onError:(TcpSocketClient *)client withError:(NSError *)err { - NSString *msg = err.localizedFailureReason ?: err.localizedDescription; + NSString *msg = err.localizedDescription ?: err.localizedFailureReason; [self sendEventWithName:@"error" body:@{@"id" : client.id, @"error" : msg}]; }
:tada: This issue has been resolved in version 6.0.5 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
On iOS you always receive the error message "error in connect() function". By switching to
localizedDescription
we could get more specific error messages such as "Connection refused".patch-package: