*Better catch rpc node errors and ensure they are passed through properly to the client
This commit is contained in:
parent
9a9a888bcb
commit
d3a90c7714
|
@ -68,7 +68,20 @@ export function proxyRpcMethod(
|
|||
provider = getRpcProvider(chainId as string);
|
||||
}
|
||||
gatewayProviders[chainId as string] = provider;
|
||||
return await provider(method, args);
|
||||
|
||||
let resp;
|
||||
try {
|
||||
resp = await provider(method, args);
|
||||
} catch (e: any) {
|
||||
e = e as Error;
|
||||
if ("error" in e) {
|
||||
return e.error;
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
return await sendRelay(
|
||||
|
|
Loading…
Reference in New Issue