Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/components/Communicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export abstract class Communicator<
* @hidden
*/
private _Call_function(name: string, ...params: any[]): Promise<any> {
return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
// READY TO SEND ?
const error: Error | null = this.inspectReady(
"Communicator._Call_fuction",
Expand Down Expand Up @@ -227,7 +227,11 @@ export abstract class Communicator<
resolve,
reject,
});
await this.sendData(invoke);

Promise.resolve(this.sendData(invoke)).catch((error) => {
this.promises_.erase(invoke.uid);
reject(error);
});
});
}

Expand Down Expand Up @@ -509,7 +513,9 @@ export abstract class Communicator<
props.return.value = serializeError(props.return.value);

// RETURNS
await this.sendData(props.return);
try {
await this.sendData(props.return);
} catch {}
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty catch block silently swallows all errors from sendData(). While this might be intentional for handling closed connections, it makes debugging difficult and hides unexpected errors. Consider at minimum logging the error at debug/trace level, or checking the error type to only swallow expected connection-closed errors. This would help developers troubleshoot issues where sendData() fails for unexpected reasons (e.g., serialization errors, network issues).

Suggested change
} catch {}
} catch (error) {
console.debug("Failed to send data in _Send_return:", error);
}

Copilot uses AI. Check for mistakes.
}
}

Expand Down