The MetaMask extension has this feature to warn about transaction errors before a transaction is being made:
ALERT: Transaction Error. Exception thrown in contract code.
And a follow-up question: unfortunately MetaMask doesn't show the contents of errors thrown by
require() statements in solidity smart contracts. When I trigger the same error in
truffle console however, I do see those contents. Is there a way to get this in the frontend?