|
|
@@ -58,14 +58,16 @@ export class IpcClient extends EventEmitter<IpcClientEvents> {
|
|
|
|
|
|
private onMessage(data: unknown) {
|
|
|
if (typeof data !== "object") {
|
|
|
- this._log("[client#onMessage] invalid data", data)
|
|
|
+ this.log(`[client#onMessage] invalid data -> ${JSON.stringify(data)}`)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
const result = ipcMessageSchema.safeParse(data)
|
|
|
|
|
|
if (!result.success) {
|
|
|
- this.log("[client#onMessage] invalid payload", result.error, data)
|
|
|
+ this.log(
|
|
|
+ `[client#onMessage] invalid payload -> ${JSON.stringify(result.error.issues)} -> ${JSON.stringify(data)}`,
|
|
|
+ )
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -113,9 +115,10 @@ export class IpcClient extends EventEmitter<IpcClientEvents> {
|
|
|
public disconnect() {
|
|
|
try {
|
|
|
ipc.disconnect(this._id)
|
|
|
- // @TODO: Should we set _disconnect here?
|
|
|
} catch (error) {
|
|
|
- this.log("[client#disconnect] error disconnecting", error)
|
|
|
+ this.log(
|
|
|
+ `[client#disconnect] error disconnecting -> ${error instanceof Error ? error.message : String(error)}`,
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|