Skip to content

Instantly share code, notes, and snippets.

@jamesmorgan
Last active January 2, 2019 10:17
Show Gist options
  • Save jamesmorgan/eacf00a1fde0f5d94e8a4e82511ace55 to your computer and use it in GitHub Desktop.
Save jamesmorgan/eacf00a1fde0f5d94e8a4e82511ace55 to your computer and use it in GitHub Desktop.
revert-reasons.js
try {
await contract.methodCall();
} catch (error) {
// error.reason now populated with an REVERT reason
console.log("Failure reason", error.reason);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment