diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx
index da5ade95f6..4675143341 100644
--- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx
+++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx
@@ -39,7 +39,10 @@ export const TechDocsPage = () => {
return Promise.resolve(undefined);
}, [kind, namespace, name, techdocsApi, documentReady]);
- const { value: entityMetadataValue } = useAsync(() => {
+ const {
+ value: entityMetadataValue,
+ error: entityMetadataError,
+ } = useAsync(() => {
return techdocsApi.getEntityMetadata({ kind, namespace, name });
}, [kind, namespace, name, techdocsApi]);
@@ -47,10 +50,8 @@ export const TechDocsPage = () => {
setDocumentReady(true);
}, [setDocumentReady]);
- if (entityMetadataRequest?.error) {
- return (
-
- );
+ if (entityMetadataError) {
+ return ;
}
return (