feat: add layered render recovery boundaries
This commit is contained in:
+5
-14
@@ -2,19 +2,10 @@ import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { createAnonymousSessionAdapter } from "../adapters/auth/external-session-adapter.js";
|
||||
import { BootErrorShell } from "../presentation/boundaries/boot-error-shell.jsx";
|
||||
import { AppRouter } from "../presentation/routes/app-router.jsx";
|
||||
import { BootConfigError, loadRuntimeConfig } from "./load-runtime-config.js";
|
||||
|
||||
/** @param {{ supportReference: string }} props */
|
||||
function BootErrorShell({ supportReference }) {
|
||||
return (
|
||||
<main role="alert">
|
||||
<h1>애플리케이션을 시작할 수 없습니다.</h1>
|
||||
<p>지원 참조: {supportReference}</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
const rootElement = document.getElementById("root");
|
||||
|
||||
if (!rootElement) {
|
||||
@@ -35,12 +26,12 @@ async function boot() {
|
||||
</StrictMode>,
|
||||
);
|
||||
} catch (error) {
|
||||
const supportReference =
|
||||
const safe =
|
||||
error instanceof BootConfigError
|
||||
? error.safe.supportReference
|
||||
: "boot:unknown";
|
||||
? error.safe
|
||||
: { supportReference: "boot:unknown" };
|
||||
|
||||
root.render(<BootErrorShell supportReference={supportReference} />);
|
||||
root.render(<BootErrorShell {...safe} />);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user