Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RpcProxyFactory always produced console error log #13189

Closed
martin-fleck-at opened this issue Dec 19, 2023 · 0 comments · Fixed by #13191
Closed

RpcProxyFactory always produced console error log #13189

martin-fleck-at opened this issue Dec 19, 2023 · 0 comments · Fixed by #13191
Assignees
Labels
messaging issues related to messaging
Milestone

Comments

@martin-fleck-at
Copy link
Contributor

Feature Description:

There is some code in the RpcProxyFactory that always logs an error even though the error is re-thrown and could by handled by a client, thus spamming the log unnecessarily:

protected async onRequest(method: string, ...args: any[]): Promise<any> {
try {
if (this.target) {
return await this.target[method](...args);
} else {
throw new Error(`no target was set to handle ${method}`);
}
} catch (error) {
const e = this.serializeError(error);
if (e instanceof ResponseError) {
throw e;
}
const reason = e.message || '';
const stack = e.stack || '';
console.error(`Request ${method} failed with error: ${reason}`, stack);
throw e;
}
}

I suggest to remove that code or at least only provide it through a logger that can be provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
messaging issues related to messaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants