From 12503658ed71233ad3236d1d4b7e02194736ff8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20G=C5=82owala?= Date: Mon, 26 Feb 2024 17:31:35 +0100 Subject: [PATCH] fix(nuxt): align `error` in `showError`/`createError` with h3 (#25945) --- packages/nuxt/src/app/composables/error.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/error.ts b/packages/nuxt/src/app/composables/error.ts index 2f6a748a08..80ab8a83a0 100644 --- a/packages/nuxt/src/app/composables/error.ts +++ b/packages/nuxt/src/app/composables/error.ts @@ -13,7 +13,10 @@ export interface NuxtError extends H3Error {} /** @since 3.0.0 */ export const showError = ( - error: string | Error | Partial> + error: string | Error | (Partial> & { + status?: number; + statusText?: string; + }) ) => { const nuxtError = createError(error) @@ -56,7 +59,10 @@ export const isNuxtError = ( /** @since 3.0.0 */ export const createError = ( - error: string | Partial> + error: string | Error | (Partial> & { + status?: number; + statusText?: string; + }) ) => { const nuxtError: NuxtError = createH3Error(error)