You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/kit/src/exports/index.js
+14-8
Original file line number
Diff line number
Diff line change
@@ -24,10 +24,11 @@ export { VERSION } from '../version.js';
24
24
* When called during request handling, this will cause SvelteKit to
25
25
* return an error response without invoking `handleError`.
26
26
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
27
-
*
28
-
* @overload
29
27
* @param {NumericRange<400, 599>} 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.
30
28
* @param {App.Error} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
29
+
* @overload
30
+
* @param {NumericRange<400, 599>} status
31
+
* @param {App.Error} body
31
32
* @return {never}
32
33
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
33
34
* @throws {Error} If the provided status is invalid (not between 400 and 599).
@@ -37,20 +38,25 @@ export { VERSION } from '../version.js';
37
38
* When called during request handling, this will cause SvelteKit to
38
39
* return an error response without invoking `handleError`.
39
40
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
40
-
*
41
-
* @overload
42
41
* @param {NumericRange<400, 599>} 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.
43
42
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} [body] An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
* Throws an error with a HTTP status code and an optional message.
52
+
* When called during request handling, this will cause SvelteKit to
53
+
* return an error response without invoking `handleError`.
54
+
* Make sure you're not catching the thrown error, which would prevent SvelteKit from handling it.
55
+
* @param {NumericRange<400, 599>} 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.
56
+
* @param {{ message: string } extends App.Error ? App.Error | string | undefined : never} body An object that conforms to the App.Error type. If a string is passed, it will be used as the message property.
51
57
* @return {never}
52
-
* @throws {HttpError}
53
-
* @throws {Error}
58
+
* @throws {HttpError} This error instructs SvelteKit to initiate HTTP error handling.
59
+
* @throws {Error} If the provided status is invalid (not between 400 and 599).
0 commit comments