Skip to content

Commit

Permalink
Handle unhandled promise rejection. Closes #2473.
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Jan 9, 2025
1 parent 191962e commit 3d4efa2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/controller/app/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ export default (sbp('sbp/selectors/register', {
try {
await sbp('chelonia/contract/sync', identityContractID)
} catch (e) {
// Since we're throwing or returning, the `await` below will not
// be used. In either case, login won't complete after this point,
// so errors there aren't relevant anymore.
loginCompletePromise.catch((e) => {
// Using `warn` level because this error is not so relevant
// However, errors might be helpful for debugging purposes, so
// we still log it.
console.warn('[gi.app/identity/login] Error in login complete promise', e)
})

// To make it easier to test things during development, if the
// identity contract no longer exists, we automatically log out
// If we're in production mode, we show a prompt instead as logging
Expand Down

0 comments on commit 3d4efa2

Please sign in to comment.