I have a contract that is based on OpenZeppelin contracts. I have added a code that limits the amount per one transaction. It uses standard require function to check this limit and if exceeded, it throws an error:
require(amount <= _maxTxAmount, "Transfer exceeds the maximum allowed amount!");
Is there a way how to pass this particular error message to the dialog box a trader sees, when he clicks on the swap button on PancakeSwap or UniSwap? Because right now, the only message that PancakeSwap shows (when the trader actually exceeds the max. transaction amount) is "The transaction cannot succeed due to error: undefined. This is probably an issue with one of the tokens you are swapping.". It's misleading to the trader, because he doesn't get to see the real reason why the transaction failed.
It's important to note that I'm running the contract on BSC testnet. Is it different on the main net, meaning will the actual error message be shown?