File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
windows/ReactNativeStaticServer Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,16 @@ void OnSignal(std::string signal, std::string details) {
40
40
// thus MUST BE called before the object is dropped below, if it is.
41
41
if (!pendingResult) mod->sendEvent (signal, details);
42
42
43
+ double id = server->id ();
43
44
if (signal == CRASHED || signal == TERMINATED) {
44
45
delete server;
45
46
server = NULL ;
46
47
}
47
48
48
49
if (pendingResult) {
49
- if (signal == CRASHED) RNException (" Server crashed" ).reject (*pendingResult);
50
+ if (signal == CRASHED) {
51
+ RNException (" Server #" + std::to_string (id) + " crashed" ).reject (*pendingResult);
52
+ }
50
53
else pendingResult->Resolve (details);
51
54
delete pendingResult;
52
55
pendingResult = NULL ;
@@ -138,7 +141,9 @@ void ReactNativeModule::start(
138
141
lock_sem ();
139
142
140
143
if (server) {
141
- RNException (" Another server instance is active" ).reject (result);
144
+ RNException (
145
+ " Failed to launch server #" + std::to_string (id) +
146
+ " , another server instance (#" + server->id_str () + " ) is active" ).reject (result);
142
147
unlock_sem ();
143
148
return ;
144
149
};
@@ -187,6 +192,6 @@ void ReactNativeModule::stop(React::ReactPromise<std::string>&& result) noexcept
187
192
// will catch it and report to JS layer in RN way.
188
193
}
189
194
catch (...) {
190
- RNException (" Failed to gracefully shutdown the server" ).reject (result);
195
+ RNException (" Failed to gracefully shutdown the server # " + server-> id_str () ).reject (result);
191
196
}
192
197
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ namespace winrt::ReactNativeStaticServer {
19
19
SignalConsumer signalConsumer);
20
20
21
21
inline double id () { return _id; }
22
+ inline std::string id_str () { return std::to_string (_id); }
22
23
23
24
void launch ();
24
25
void shutdown ();
You can’t perform that action at this time.
0 commit comments