Skip to content

Commit 19436e9

Browse files
committed
[futurepress#96] iOS: Improves error messages
1 parent d0a5218 commit 19436e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ios/ReactNativeStaticServer.mm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,16 @@ - (NSDictionary*) getConstants {
9898
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
9999

100100
if (self->server) {
101-
auto e = [[RNSSException name:@"Another server instance is active"] log];
101+
NSString *name = [NSString stringWithFormat:@"Failed to launch server #%@, another server instance (#%@) is active", serverId, self->server.serverId];
102+
auto e = [[RNSSException name:name] log];
102103
[e reject:reject];
103104
dispatch_semaphore_signal(sem);
104105
return;
105106
}
106107

107108
if (pendingResolve != nil || pendingReject != nil) {
108-
auto e = [[RNSSException name:@"Internal error"
109-
details:@"Non-expected pending promise"] log];
109+
NSString *name = [NSString stringWithFormat:@"Internal error (server #%@)", serverId];
110+
auto e = [[RNSSException name:name details:@"Non-expected pending promise"] log];
110111
[e reject:reject];
111112
dispatch_semaphore_signal(sem);
112113
return;
@@ -129,7 +130,8 @@ - (NSDictionary*) getConstants {
129130
];
130131
} else {
131132
if (signal == CRASHED) {
132-
[[RNSSException name:@"Server crashed" details:details]
133+
NSString *name = [NSString stringWithFormat:@"Server #%@ crashed", serverId];
134+
[[RNSSException name:name details:details]
133135
reject:pendingReject];
134136
} else pendingResolve(details);
135137
pendingResolve = nil;

0 commit comments

Comments
 (0)