0

i am trying to execute uniswap v2 tokenswap function from node.js using ethers.js

How can i get the reason for transaction fail ?

Listening to transaction being mined i get only the status (1 for complete, 0 for fail) but, i can't get the details like on etherscan ('Fail with error 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'')

provider.on (transactionHash) results with ...

logs: [],
confirmations: 1,
cumulativeGasUsed: BigNumber { _hex: '0x2ca73e', _isBigNumber: true },
status: 0,
0