From c1ffb9d30d78dc2a1b468e2075591ea8d273b646 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Wed, 14 May 2025 07:36:50 -0700 Subject: [PATCH] docs: expand docs for fail method --- packages/kit/src/exports/index.js | 6 +++--- packages/kit/types/index.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/kit/src/exports/index.js b/packages/kit/src/exports/index.js index 4d2bb75223f3..e587ede88581 100644 --- a/packages/kit/src/exports/index.js +++ b/packages/kit/src/exports/index.js @@ -180,14 +180,14 @@ export function text(body, init) { } /** - * Create an `ActionFailure` object. + * Create an `ActionFailure` object. Call when form submission fails. * @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. * @overload * @param {number} status * @returns {import('./public.js').ActionFailure} */ /** - * Create an `ActionFailure` object. + * Create an `ActionFailure` object. Call when form submission fails. * @template {Record | undefined} [T=undefined] * @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. * @param {T} data Data associated with the failure (e.g. validation errors) @@ -197,7 +197,7 @@ export function text(body, init) { * @returns {import('./public.js').ActionFailure} */ /** - * Create an `ActionFailure` object. + * Create an `ActionFailure` object. Call when form submission fails. * @param {number} status * @param {any} [data] * @returns {import('./public.js').ActionFailure} diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index b87d7007cc98..30ac9392314e 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -2001,12 +2001,12 @@ declare module '@sveltejs/kit' { */ export function text(body: string, init?: ResponseInit | undefined): Response; /** - * Create an `ActionFailure` object. + * Create an `ActionFailure` object. Call when form submission fails. * @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. * */ export function fail(status: number): ActionFailure; /** - * Create an `ActionFailure` object. + * Create an `ActionFailure` object. Call when form submission fails. * @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. * @param data Data associated with the failure (e.g. validation errors) * */