Skip to content

Commit

Permalink
refactor: throw RPCError with original error
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 24, 2024
1 parent 6a5f378 commit 168032d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/dapi/lib/externalApis/tenderdash/requestTenderRpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ function requestTenderRpcFactory(rpcClient) {
throw new UnavailableGrpcError('Tenderdash is not available');
}

e.message = `Failed to request ${uri}: ${e.message}`;

throw e;
throw new RPCError(
e.code || -32602,
`Failed to request ${uri}: ${e.message}`,
e,
);
}

const { result, error: jsonRpcError } = response;
Expand Down

0 comments on commit 168032d

Please sign in to comment.