MCPcopy
hub / github.com/nuxt/nuxt / useError

Function useError

packages/nuxt/src/app/composables/error.ts:13–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11/** @since 3.0.0 */
12/* @__NO_SIDE_EFFECTS__ */
13export const useError = (): Ref<NuxtPayload['error']> => toRef(useNuxtApp().payload, 'error')
14
15// #34138 - `Omit` breaks the Error inheritance chain, causing `@typescript-eslint/only-throw-error` to fail
16// Adding `Error` explicitly restores throwability. TODO: remove `Error` in Nuxt 5 when `Omit` is no longer needed

Callers 6

setupFunction · 0.90
setupFunction · 0.90
setupFunction · 0.90
showErrorFunction · 0.85
clearErrorFunction · 0.85

Calls 1

useNuxtAppFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…