Skip to content

Commit

Permalink
fix: log JSON-RPC subscription errors to the console (#3392)
Browse files Browse the repository at this point in the history
* Fix skip log error from message

* Collapse error into a single unified one

---------

Co-authored-by: Steven Luscher <steven.luscher@anza.xyz>
  • Loading branch information
barbarosh and steveluscher authored Oct 17, 2024
1 parent 0c695dc commit e345937
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6252,13 +6252,13 @@ export class Connection {
] = subscription.callbacks;
await this._updateSubscriptions();
} catch (e) {
if (e instanceof Error) {
console.error(
`${method} error for argument`,
console.error(
`Received ${e instanceof Error ? '' : 'JSON-RPC '}error calling \`${method}\``,
{
args,
e.message,
);
}
error: e,
},
);
if (!isCurrentConnectionStillActive()) {
return;
}
Expand Down

0 comments on commit e345937

Please sign in to comment.