diff --git a/examples/dataset-frictionless/pages/index.js b/examples/dataset-frictionless/pages/index.js
index 067c1c82..2b8931b1 100644
--- a/examples/dataset-frictionless/pages/index.js
+++ b/examples/dataset-frictionless/pages/index.js
@@ -14,7 +14,7 @@ const datasetsDirectory = process.env.PORTAL_DATASET_PATH || path.join(process.c
export default function Home({ dataset, specs }) {
- if (!dataset) {
+ if (!dataset || dataset.hasError) {
return (
@@ -23,8 +23,10 @@ export default function Home({ dataset, specs }) {
-
- No dataset found in path
+
)
@@ -48,11 +50,11 @@ export default function Home({ dataset, specs }) {
-
+
-
+
@@ -85,10 +87,18 @@ export default function Home({ dataset, specs }) {
)}
-
+ {
+ dataset.readmeHtml != "" ? (
+
+ ) : (
+ ""
+ )
+ }
+
)
@@ -96,12 +106,17 @@ export default function Home({ dataset, specs }) {
export async function getStaticProps() {
- if (!datasetsDirectory) {
- return { props: {} }
+ const dataset = await getDataset(datasetsDirectory)
+
+ if (dataset.hasError == true) {
+ return {
+ props: {
+ dataset
+ }
+ }
+ } else {
+ const datasetWithViews = addView(dataset)
+ return datasetWithViews
}
- const dataset = await getDataset(datasetsDirectory)
- const datasetWithViews = addView(dataset)
- return datasetWithViews
-
}