Getline-Network / getline

Distributed P2P Lending System
https://getline.in
Apache License 2.0
9 stars 6 forks source link

[front-end] Handle errors in metamask actions #72

Open balinskia opened 6 years ago

balinskia commented 6 years ago

We need to handle actions such as:

A popup would be nice for it

balinskia commented 6 years ago
gatherCollateral(shortId, amount).then(()=>{
   commit('COLLATERAL_TRANSFERED', { shortId });
   onSuccess();
}).catch((err: Error)=>{
  console.error(err);
  commit('SOME_GENERIC_ERROR_PAGE', { msg: "Transferring collateral failed. Do you have enough funds?" });
});