mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Fix undefined stack on some IPC errors (#624)
This commit is contained in:
1 parent
c8e54cd563
commit
201209efb3
1 file changed
+2
-2
@@ -564,8 +564,8 @@ export class FactorioServer extends events.EventEmitter {
|
|||||||
|
|
||||||
// TODO at the moment this is just a helper function, it has the potential for schema checking
|
// TODO at the moment this is just a helper function, it has the potential for schema checking
|
||||||
handle<Event>(eventName: string, handler: (event: Event) => Promise<void>) {
|
handle<Event>(eventName: string, handler: (event: Event) => Promise<void>) {
|
||||||
this.on(`ipc-${eventName}`, (event) => handler(event).catch(err => {
|
this.on(`ipc-${eventName}`, (event) => handler(event).catch((err: Error) => {
|
||||||
this._logger.error(`Error handling ipc event:\n${err.stack}`);
|
this._logger.error(`Error handling ipc event:\n${err.stack ?? err.message}`);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user