Hi guys,
I use useWeb3Contract
to interact with my solidity functions. When I click on a button I execute the function and I catch the message success and message error :
<button
onClick={async () =>
await voting({
onSuccess: (mess) => {
setArrayAddress((prevArray) =>[...prevArray, address])
handleSuccess(mess, 'info', `L\'adresse ${address} a bien été ajouté`, 'Ajout d\'une nouvelle adresse', 'bell')
},
onError: (err) => {
handleError(err, `${err}`, 'Erreur', 'x')
console.log(err)
}
})
}
>
The result of the console.log :
As you can see. it’s a huge text and just above there is the message error from metamask which is more readable and I would like to get the message from this error to display it but don’t know how to do it.
Any idea ?