Commit 8d9ddf36 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: display specific gas estimation error (#5863)

parent 6cfd5fa4
...@@ -56,9 +56,8 @@ export function useUniversalRouterSwapCallback( ...@@ -56,9 +56,8 @@ export function useUniversalRouterSwapCallback(
try { try {
gasEstimate = await provider.estimateGas(tx) gasEstimate = await provider.estimateGas(tx)
} catch (gasError) { } catch (gasError) {
await provider.call(tx) // this should throw the actual error console.warn(gasError)
// If the actual error is not thrown, just try again: throw new InvalidSwapError('Gas estimation failed. Wait a few minutes and try again.')
gasEstimate = await provider.estimateGas(tx)
} }
const gasLimit = calculateGasMargin(gasEstimate) const gasLimit = calculateGasMargin(gasEstimate)
const response = await provider const response = await provider
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment