diff --git a/app/error.tsx b/app/error.tsx
new file mode 100644
index 0000000..b98868c
--- /dev/null
+++ b/app/error.tsx
@@ -0,0 +1,38 @@
+"use client";
+import { useEffect } from "react";
+import { Footer, Nav } from "@/components/landing/chrome";
+import { ProblemPage } from "@/components/problem-page";
+
+export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
+ useEffect(() => console.error(error), [error]);
+ return (
+
+
+
+ Try again
+
+ }
+ >
+
+ Not your fault. Trying again often helps; if it keeps happening, an{" "}
+
+ issue
+ {" "}
+ with the address and the digest on the right lets me find it.
+
+
+
+
+ );
+}
diff --git a/app/global-error.tsx b/app/global-error.tsx
new file mode 100644
index 0000000..7c3b94d
--- /dev/null
+++ b/app/global-error.tsx
@@ -0,0 +1,32 @@
+"use client";
+// When the root layout itself fails: no providers, so no nav and no search.
+import "./globals.css";
+import { ProblemPage } from "@/components/problem-page";
+
+export default function GlobalError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
+ return (
+
+
+
+ Try again
+
+ }
+ >
+
Something below every page failed. Trying again usually helps.
+
+
+
+ );
+}
diff --git a/app/not-found.tsx b/app/not-found.tsx
new file mode 100644
index 0000000..c98c2b2
--- /dev/null
+++ b/app/not-found.tsx
@@ -0,0 +1,20 @@
+import type { Metadata } from "next";
+import { Footer, Nav } from "@/components/landing/chrome";
+import { ProblemPage } from "@/components/problem-page";
+
+export const metadata: Metadata = { title: "Not found", robots: { index: false } };
+
+export default function NotFound() {
+ return (
+
+
+
+
+ This address is not in the contract. It may have moved when the docs were reordered, or it never existed. The search
+ usually finds what it was meant to be.
+
+
+
+
+ );
+}
diff --git a/components/problem-page.tsx b/components/problem-page.tsx
new file mode 100644
index 0000000..36c5082
--- /dev/null
+++ b/components/problem-page.tsx
@@ -0,0 +1,120 @@
+"use client";
+// 404 and 500 as inkan answers them: an RFC 9457 problem, with the way back next to it.
+import { motion } from "motion/react";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import { useSearchContext } from "fumadocs-ui/contexts/search";
+import type { ReactNode } from "react";
+import { Seal } from "@/components/seal";
+
+const WAYS = [
+ { href: "/docs", label: "Docs", note: "start at the contract" },
+ { href: "/hanko", label: "Hanko", note: "plugins, middleware, stores" },
+ { href: "/blog", label: "Blog", note: "what changed lately" },
+ { href: "/", label: "Home", note: "the front page" },
+];
+
+function SearchButton() {
+ const { setOpenSearch } = useSearchContext();
+ return (
+
+ );
+}
+
+function Response({ status, reason, problem }: { status: number; reason: string; problem: Record }) {
+ const entries = Object.entries(problem);
+ return (
+