Added error handling and new alerts in DiscoverView

This commit is contained in:
Matthew Raymer
2023-07-20 16:36:33 +08:00
parent 05a7758c65
commit c4443f2ed1
2 changed files with 30 additions and 0 deletions

View File

@@ -182,4 +182,14 @@ const router = createRouter({
routes,
});
const errorHandler = (error, to, from) => {
// Handle the error here
console.error(error, to, from);
console.log("XXXXX");
// You can also perform additional actions, such as displaying an error message or redirecting the user to a specific page
};
router.onError(errorHandler); // Assign the error handler to the router instance
export default router;