___anj___
___anj___
Explore posts from servers
AAlokai
Created by ___anj___ on 3/9/2023 in #🙋|general-help
How to detect if a page has an error inside the layout
Inside the default layout I need to detect if there is an error page displayed (like for example a 404 page). How should I do this? I've tried doing this by accessing app.context._errored but this value is not refreshed after a client side navigation, so if we navigate from page with an error to a working page the value of this field remains the same. Is there an out of the box solution for that or we need to develop custom solution? And if we need to develop custom solution how should one go about it? Should we create a composable that will hold the error state and somehow update it when error layout is invoked? What would be the proper lifecycle hoot to update such variable?
28 replies