mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): align error
in showError
/createError
with h3 (#25945)
This commit is contained in:
parent
ff1bb56e3f
commit
12503658ed
@ -13,7 +13,10 @@ export interface NuxtError<DataT = unknown> extends H3Error<DataT> {}
|
||||
|
||||
/** @since 3.0.0 */
|
||||
export const showError = <DataT = unknown>(
|
||||
error: string | Error | Partial<NuxtError<DataT>>
|
||||
error: string | Error | (Partial<NuxtError<DataT>> & {
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
})
|
||||
) => {
|
||||
const nuxtError = createError<DataT>(error)
|
||||
|
||||
@ -56,7 +59,10 @@ export const isNuxtError = <DataT = unknown>(
|
||||
|
||||
/** @since 3.0.0 */
|
||||
export const createError = <DataT = unknown>(
|
||||
error: string | Partial<NuxtError<DataT>>
|
||||
error: string | Error | (Partial<NuxtError<DataT>> & {
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
})
|
||||
) => {
|
||||
const nuxtError: NuxtError<DataT> = createH3Error<DataT>(error)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user