Improve node error handling

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2023-08-24 09:42:17 +02:00
parent 1efeb41667
commit 34b2f569c1
2 changed files with 10 additions and 7 deletions
+10 -6
View File
@@ -109,11 +109,15 @@ export async function loadNodeRoute(
},
};
} catch (error: any) {
return {
resource: "notFound",
params: {
title: "Node not found",
},
};
if (error.message === "Failed to fetch") {
return {
resource: "notFound",
params: {
title: "Node not found",
},
};
} else {
throw error;
}
}
}
-1
View File
@@ -447,7 +447,6 @@ test("external markdown link", async ({ page }) => {
});
await page.goto(`${markdownUrl}/tree/main/footnotes.md`);
await page.getByRole("link", { name: "https://example.com" }).click();
await page.pause();
await expect(page).toHaveURL("https://example.com");
});