Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Improve node error handling
Rūdolfs Ošiņš committed 2 years ago
commit 34b2f569c1a97df5e9be5cfa2402327222224b86
parent 1efeb4166742020627bf5621e936a96836f81f44
2 files changed +10 -7
modified src/views/nodes/router.ts
@@ -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;
+
    }
  }
}
modified tests/e2e/project.spec.ts
@@ -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");
});