Files
gil-wiki/reference/4.api/3.utils/clear-error.md
gil 5f664546cf feat: 위키 저장소 초기 커밋
- CLAUDE.md 운영 규칙
- wiki/ 정리된 지식 페이지 (Nuxt + Claude Code)
- raw/ 원본 자료
- reference/ Nuxt 4.x 공식 문서

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 00:31:51 +09:00

888 B

title, description, links
title description links
clearError The clearError composable clears all handled errors.
label icon to size
Source i-simple-icons-github https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/error.ts xs

Within your pages, components, and plugins, you can use clearError to clear all errors and redirect the user.

Parameters:

  • options?: { redirect?: string }

You can provide an optional path to redirect to (for example, if you want to navigate to a 'safe' page).

// Without redirect
clearError()

// With redirect
clearError({ redirect: '/homepage' })

Errors are set in state using useError(). The clearError composable will reset this state and calls the app:error:cleared hook with the provided options.

:read-more{to="/docs/4.x/getting-started/error-handling"}