From 7e5c39d5a9f33126e5a05b7d30d89d515f402907 Mon Sep 17 00:00:00 2001 From: nhe23 Date: Tue, 25 Jan 2022 00:21:52 +0100 Subject: [PATCH 1/3] added documentation on status and error in page store --- documentation/docs/02-layouts.md | 3 ++- documentation/docs/05-modules.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/docs/02-layouts.md b/documentation/docs/02-layouts.md index 2a889c2f1e01..613b709285dd 100644 --- a/documentation/docs/02-layouts.md +++ b/documentation/docs/02-layouts.md @@ -110,5 +110,6 @@ If an error component has a [`load`](#loading) function, it will be called with

{title}

``` - +> Layout components also have access to the status code and the error via the [page store](#modules-$app-stores) +> > Server-side stack traces will be removed from `error` in production, to avoid exposing privileged information to users. diff --git a/documentation/docs/05-modules.md b/documentation/docs/05-modules.md index d536dd0a0002..72b6068846bb 100644 --- a/documentation/docs/05-modules.md +++ b/documentation/docs/05-modules.md @@ -68,7 +68,7 @@ Because of that, the stores are not free-floating objects: they must be accessed The stores themselves attach to the correct context at the point of subscription, which means you can import and use them directly in components without boilerplate. However, it still needs to be called synchronously on component or page initialisation when the `$`-prefix isn't used. Use `getStores` to safely `.subscribe` asynchronously instead. - `navigating` is a [readable store](https://svelte.dev/tutorial/readable-stores). When navigating starts, its value is `{ from, to }`, where `from` and `to` are both [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) instances. When navigating finishes, its value reverts to `null`. -- `page` contains an object with the current [`url`](https://developer.mozilla.org/en-US/docs/Web/API/URL), [`params`](#loading-input-params) and [`stuff`](#loading-output-stuff). +- `page` contains an object with the current [`url`](https://developer.mozilla.org/en-US/docs/Web/API/URL), [`params`](#loading-input-params), [`stuff`](#loading-output-stuff), [`status`](#loading-output-status) and [`error`](#loading-output-error). - `session` is a [writable store](https://svelte.dev/tutorial/writable-stores) whose initial value is whatever was returned from [`getSession`](#hooks-getsession). It can be written to, but this will _not_ cause changes to persist on the server — this is something you must implement yourself. ### $lib From 0c285f1452e25664240274269263bd4a3ac6d30f Mon Sep 17 00:00:00 2001 From: nhe23 Date: Tue, 25 Jan 2022 00:33:56 +0100 Subject: [PATCH 2/3] changed wording --- documentation/docs/02-layouts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/02-layouts.md b/documentation/docs/02-layouts.md index 613b709285dd..082e1c657887 100644 --- a/documentation/docs/02-layouts.md +++ b/documentation/docs/02-layouts.md @@ -110,6 +110,6 @@ If an error component has a [`load`](#loading) function, it will be called with

{title}

``` -> Layout components also have access to the status code and the error via the [page store](#modules-$app-stores) +> Layout components also have access to `error` and `status` via the [page store](#modules-$app-stores) > > Server-side stack traces will be removed from `error` in production, to avoid exposing privileged information to users. From d6f4cd267b3a865d08b4dab9a78632b029f1d26f Mon Sep 17 00:00:00 2001 From: nhe23 Date: Tue, 25 Jan 2022 00:36:34 +0100 Subject: [PATCH 3/3] blank line --- documentation/docs/02-layouts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/docs/02-layouts.md b/documentation/docs/02-layouts.md index 082e1c657887..6211e825b3d1 100644 --- a/documentation/docs/02-layouts.md +++ b/documentation/docs/02-layouts.md @@ -110,6 +110,7 @@ If an error component has a [`load`](#loading) function, it will be called with

{title}

``` + > Layout components also have access to `error` and `status` via the [page store](#modules-$app-stores) > > Server-side stack traces will be removed from `error` in production, to avoid exposing privileged information to users.