Skip to content

Commit

Permalink
Handle game create tx reject
Browse files Browse the repository at this point in the history
  • Loading branch information
lindlof committed Dec 12, 2020
1 parent bb933c6 commit 26ce7cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,20 @@ const playGame = async (
} catch (e) {
if (e instanceof Error) {
if (e.message === 'ciphertext not set') return;
if (e.message === 'Request rejected') {
enqueueSnackbar('Transaction rejected', { variant: 'error' });
setGame(undefined);
return;
}
if (e.message.includes('Error when posting tx ')) {
console.log('playGame error:', e.message);
enqueueSnackbar('Error posting transaction', { variant: 'error' });
setGame(undefined);
return;
}
}
console.log('playGame error:', e.message);
enqueueSnackbar('Game creation erroring', { variant: 'error' });
enqueueSnackbar('Game creation error', { variant: 'error' });
}
};

Expand Down

0 comments on commit 26ce7cf

Please sign in to comment.