Hi. when you develop a web3 related website, handling and informing end users of what's going on is a essence.
The only file you will need to import is Error.js.
<script type="text/javascript" src="Errors.js"></script>
Pass error code to like this
let errormsg = Getweb3ErrorReason(transaction.code);
console.log(errormsg);