Skip to content

Commit

Permalink
feat: properly defined message for non-Error errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanjassal committed Nov 6, 2024
1 parent bd752cc commit 7fb0b5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RPCServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class RPCServer {
try {
const rpcError: JSONRPCResponseError = {
code: errors.JSONRPCResponseErrorCode.RPCRemote,
message: e.message,
message: e.message ?? e.constructor.name,
data: this.fromError(e),
};
const rpcErrorMessage: JSONRPCResponseFailed = {
Expand Down Expand Up @@ -599,7 +599,7 @@ class RPCServer {
try {
const rpcError: JSONRPCResponseError = {
code: errors.JSONRPCResponseErrorCode.RPCRemote,
message: e.message,
message: e.message ?? e.constructor.name,
data: this.fromError(e),
};
const rpcErrorMessage: JSONRPCResponseFailed = {
Expand Down

0 comments on commit 7fb0b5a

Please sign in to comment.