diff --git a/plugins/catalog/src/components/Router.tsx b/plugins/catalog/src/components/Router.tsx
index d1ad06a03e..c6e706c15b 100644
--- a/plugins/catalog/src/components/Router.tsx
+++ b/plugins/catalog/src/components/Router.tsx
@@ -46,9 +46,10 @@ const DefaultEntityPage = () => (
);
const EntityPageSwitch = ({ EntityPage }: { EntityPage: ComponentType }) => {
- const { entity } = useEntity();
+ const { entity, loading, error } = useEntity();
// Loading and error states
- if (!entity) return ;
+ if (loading) return ;
+ if (error || (!loading && !entity)) return ;
// Otherwise EntityPage provided from the App
// Note that EntityPage will include EntityPageLayout already
diff --git a/plugins/catalog/src/hooks/useEntity.ts b/plugins/catalog/src/hooks/useEntity.ts
index 1f076c0a05..abbfd03b5b 100644
--- a/plugins/catalog/src/hooks/useEntity.ts
+++ b/plugins/catalog/src/hooks/useEntity.ts
@@ -58,6 +58,8 @@ export const useEntityFromUrl = (): EntityLoadingStatus => {
* Always going to return an entity, or throw an error if not a descendant of a EntityProvider.
*/
export const useEntity = () => {
- const { entity } = useContext<{ entity: Entity }>(EntityContext as any);
- return { entity };
+ const { entity, loading, error } = useContext(
+ EntityContext as any,
+ );
+ return { entity, loading, error };
};