Skip to content

Commit 39f7b73

Browse files
authored
docs: expand docs for fail method (#13789)
1 parent d0f2d7b commit 39f7b73

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/kit/src/exports/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ export function text(body, init) {
180180
}
181181

182182
/**
183-
* Create an `ActionFailure` object.
183+
* Create an `ActionFailure` object. Call when form submission fails.
184184
* @param {number} 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.
185185
* @overload
186186
* @param {number} status
187187
* @returns {import('./public.js').ActionFailure<undefined>}
188188
*/
189189
/**
190-
* Create an `ActionFailure` object.
190+
* Create an `ActionFailure` object. Call when form submission fails.
191191
* @template {Record<string, unknown> | undefined} [T=undefined]
192192
* @param {number} 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.
193193
* @param {T} data Data associated with the failure (e.g. validation errors)
@@ -197,7 +197,7 @@ export function text(body, init) {
197197
* @returns {import('./public.js').ActionFailure<T>}
198198
*/
199199
/**
200-
* Create an `ActionFailure` object.
200+
* Create an `ActionFailure` object. Call when form submission fails.
201201
* @param {number} status
202202
* @param {any} [data]
203203
* @returns {import('./public.js').ActionFailure<any>}

packages/kit/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,12 +2001,12 @@ declare module '@sveltejs/kit' {
20012001
*/
20022002
export function text(body: string, init?: ResponseInit | undefined): Response;
20032003
/**
2004-
* Create an `ActionFailure` object.
2004+
* Create an `ActionFailure` object. Call when form submission fails.
20052005
* @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.
20062006
* */
20072007
export function fail(status: number): ActionFailure<undefined>;
20082008
/**
2009-
* Create an `ActionFailure` object.
2009+
* Create an `ActionFailure` object. Call when form submission fails.
20102010
* @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.
20112011
* @param data Data associated with the failure (e.g. validation errors)
20122012
* */

0 commit comments

Comments
 (0)