Catch error in resolve componentUrl

Hi, I’m new with framework7. In routes.js I have this route:
path: ‘/home/’,
async( { resolve, reject }) {
if (sessionStorage.getItem(‘userIsLoggedIn’))
resolve({componentUrl: ‘./desk/pages/home’})
resolve({url: ‘./desk/pages/welcome’})

How can I catch error if url ‘desk/pages/home’ throws an error (500, for example)?
I try…catched the resolve({componentUrl: ‘./desk/pages/home’}) instruction but no lucky…

Please, help!

Inside this html page, set event beforein

Thank you for your reply! :slight_smile:

I tried but not works… I can’t fire event “page:beforein” on that page because API fails, so the page isn’t instantiated. I need to check if resolve() fails.

SOLVED! I added an handler to router instance. Here’s my code:

async({ router, resolve, reject }) {
        router.on("routerAjaxError", () => { 
            sessionStorage.setItem('userIsLoggedIn', false); 
            //router.refreshPage(); //NOT WORKS