Skip to content

Commit 85df95a

Browse files
authored
improve(SolanaRpcFactory): Simplify thrown error (#1276)
1 parent a8551c1 commit 85df95a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@across-protocol/sdk",
33
"author": "UMA Team",
4-
"version": "4.3.84",
4+
"version": "4.3.85",
55
"license": "AGPL-3.0",
66
"homepage": "https://docs.across.to/reference/sdk",
77
"files": [

src/providers/solana/quorumFallbackRpcFactory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ export class QuorumFallbackSolanaRpcFactory extends SolanaBaseRpcFactory {
6262
errors.push([factory.rpcFactory, (error as any)?.stack || error?.toString()]);
6363

6464
if (fallbackFactories.length === 0) {
65-
throw error;
65+
throw new Error("No fallback providers left");
6666
}
6767

6868
// If one RPC provider reverted, others likely will too. Skip them.
6969
if (quorumThreshold === 1 && shouldFailImmediate(method, error)) {
70-
throw error;
70+
throw new Error(`RPC provider reverted for method ${method}`);
7171
}
7272

7373
const currentFactory = factory.rpcFactory.clusterUrl;
@@ -200,7 +200,7 @@ export class QuorumFallbackSolanaRpcFactory extends SolanaBaseRpcFactory {
200200
.then((result): [SolanaClusterRpcFactory, TResponse] => [factory.rpcFactory, result])
201201
.catch((err) => {
202202
errors.push([factory.rpcFactory, err?.stack || err?.toString()]);
203-
throw new Error("Fallback RPC call failed while trying to reach quorum", err);
203+
throw new Error("Fallback RPC call failed while trying to reach quorum");
204204
});
205205
})
206206
);

0 commit comments

Comments
 (0)