Skip to content

Commit 67e5a83

Browse files
committed
frontend: Handle createRouteURL gracefully
Signed-off-by: ashu8912 <[email protected]>
1 parent 03cd085 commit 67e5a83

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/lib/router.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,14 @@ export function createRouteURL(routeName: string, params: RouteURLProps = {}) {
872872
}
873873

874874
const url = getRoutePath(route);
875-
return generatePath(url, fullParams);
875+
let path = '';
876+
try {
877+
path = generatePath(url, fullParams);
878+
} catch (e) {
879+
console.error(`Error generating path for route ${routeName}: ${e}`);
880+
return path;
881+
}
882+
return path;
876883
}
877884

878885
export function getDefaultRoutes() {

0 commit comments

Comments
 (0)