Skip to content

Commit 98226de

Browse files
authored
docs: use less technical language to describe why catching redirects and errors is fraught (#8993)
1 parent bfa2b6e commit 98226de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

documentation/docs/20-core-concepts/20-load.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ export function load({ locals }) {
416416
}
417417
```
418418

419-
> Make sure you're not catching the thrown redirect, which results in a noop.
419+
> Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
420420
421421
In the browser, you can also navigate programmatically outside of a `load` function using [`goto`](modules#$app-navigation-goto) from [`$app.navigation`](modules#$app-navigation).
422422

packages/kit/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ export type ActionResult<
11291129
* Creates an `HttpError` object with an HTTP status code and an optional message.
11301130
* This object, if thrown during request handling, will cause SvelteKit to
11311131
* return an error response without invoking `handleError`.
1132-
* Make sure you're not catching the thrown error, which results in a noop.
1132+
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
11331133
* @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses). Must be in the range 400-599.
11341134
* @param body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
11351135
*/
@@ -1152,7 +1152,7 @@ export interface HttpError {
11521152

11531153
/**
11541154
* Create a `Redirect` object. If thrown during request handling, SvelteKit will return a redirect response.
1155-
* Make sure you're not catching the thrown redirect, which results in a noop.
1155+
* Make sure you're not catching the thrown redirect, which would prevent SvelteKit from handling it.
11561156
* @param status The [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages). Must be in the range 300-308.
11571157
* @param location The location to redirect to.
11581158
*/

0 commit comments

Comments
 (0)