Base-Aepp hosted apps: Handling "Rejected by user" exceptions

Applications running under the base-aepp browser will get a “Confirm or cancel” full screen dialog for e.g: account access , opening channels or signing transactions. If the user clicks CANCEL , a promise rejection Rejected by user will be thrown.

How can hosted aepps catch this?

Thanks!

The Base app integrates SDK in a way that address() call on Aepp side resolves with Rejected by user exception in case if the user disallowed app to use current address.

You can check this version of example app: example aepp: Show exceptions for initial method calls and refactor by davidyuk · Pull Request #641 · aeternity/aepp-sdk-js · GitHub. It shows Error: Rejected by user in the case if the user rejected account access.

1 Like