Repository: sveltejs/kit (js)

Issue:
replace `%sveltekit.message%` with `%sveltekit.error.message%`
### Describe the problem

As of https://github.com/sveltejs/kit/pull/6586 we have a standard way of dealing with errors in a SvelteKit app. It would make sense if we respected the `App.PageError` shape in `src/error.html`.

### Describe the proposed solution

Change `%sveltekit.message%` to `%sveltekit.error.message%`. We _could_ include other properties on the `error` object, but there are some caveats here (we can't allow any way for `src/error.html` to blow up during rendering) so for now we should probably just make that change, and worry about surfacing `%sveltekit.error.code%` or whatever as a post-1.0 thing

### Alternatives considered

_No response_

### Importance

would make my life easier

### Additional Information

_No response_

Pull request description:
[breaking] change sveltekit.message to sveltekit.error.message
If you use `error.html` and customized it, replace `%sveltekit.message%` inside it with `%sveltekit.error.message%`

Closes #6645

### Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.

### Tests
- [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check`

### Changesets
- [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. All changesets should be `patch` until SvelteKit 1.0


Patch:
diff --git a/.changeset/forty-news-kiss.md b/.changeset/forty-news-kiss.md
new file mode 100644
index 000000000..207c26150
--- /dev/null
+++ b/.changeset/forty-news-kiss.md
@@ -0,0 +1,5 @@
+---
+'@sveltejs/kit': patch
+---
+
+[breaking] change sveltekit.message to sveltekit.error.message
diff --git a/documentation/docs/01-project-structure.md b/documentation/docs/01-project-structure.md
index d93e514fd..f035f7368 100644
--- a/documentation/docs/01-project-structure.md
+++ b/documentation/docs/01-project-structure.md
@@ -44,7 +44,7 @@ The `src` directory contains the meat of your project.
   - `%sveltekit.nonce%` — a [CSP](/docs/configuration#csp) nonce for manually included links and scripts, if used
 - `error.html` (optional) is the page that is rendered when everything else fails. It can contain the following placeholders:
   - `%sveltekit.status%` — the HTTP status
-  - `%sveltekit.message%` — the error message
+  - `%sveltekit.error.message%` — the error message
 - `hooks.js` (optional) contains your application's [hooks](/docs/hooks)
 - `service-worker.js` (optional) contains your [service worker](/docs/service-workers)
 
diff --git a/packages/kit/src/core/config/default-error.html b/packages/kit/src/core/config/default-error.html
index eae4dbc89..665b091bc 100644
--- a/packages/kit/src/core/config/default-error.html
+++ b/packages/kit/src/core/config/default-error.html
@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8" />
-		<title>%sveltekit.message%</title>
+		<title>%sveltekit.error.message%</title>
 
 		<style>
 			body {
@@ -49,7 +49,7 @@
 		<div class="error">
 			<span class="status">%sveltekit.status%</span>
 			<div class="message">
-				<h1>%sveltekit.message%</h1>
+				<h1>%sveltekit.error.message%</h1>
 			</div>
 		</div>
 	</body>
diff --git a/packages/kit/src/exports/vite/build/build_server.js b/packages/kit/src/exports/vite/build/build_server.js
index dce2e2e84..77011b11e 100644
--- a/packages/kit/src/exports/vite/build/build_server.js
+++ b/packages/kit/src/exports/vite/build/build_server.js
@@ -33,7 +33,7 @@ const app_template = ({ head, body, assets, nonce }) => ${s(template)
 
 const error_template = ({ status, message }) => ${s(error_page)
 	.replace(/%sveltekit\.status%/g, '" + status + "')
-	.replace(/%sveltekit\.message%/g, '" + message + "')};
+	.replace(/%sveltekit\.error\.message%/g, '" + message + "')};
 
 let read = null;
 
diff --git a/packages/kit/src/exports/vite/dev/index.js b/packages/kit/src/exports/vite/dev/index.js
index 41064ad5b..b8ecb67e0 100644
--- a/packages/kit/src/exports/vite/dev/index.js
+++ b/packages/kit/src/exports/vite/dev/index.js
@@ -455,7 +455,7 @@ export async function dev(vite, vite_config, svelte_config) {
 						error_template: ({ status, message }) => {
 							return error_page
 								.replace(/%sveltekit\.status%/g, String(status))
-								.replace(/%sveltekit\.message%/g, message);
+								.replace(/%sveltekit\.error\.message%/g, message);
 						},
 						trailing_slash: svelte_config.kit.trailingSlash
 					},


Test patch:
diff --git a/packages/kit/test/apps/basics/src/error.html b/packages/kit/test/apps/basics/src/error.html
index 14d642478..4782559ed 100644
--- a/packages/kit/test/apps/basics/src/error.html
+++ b/packages/kit/test/apps/basics/src/error.html
@@ -6,6 +6,6 @@
 	</head>
 	<body>
 		<h1>Error - %sveltekit.status%</h1>
-		<p>This is the static error page with the following message: %sveltekit.message%</p>
+		<p>This is the static error page with the following message: %sveltekit.error.message%</p>
 	</body>
 </html>