목표

  • Vue 앱에서 처리하지 않은 에러를 전역적으로 처리하는 방법을 이해한다.

app.config.errorHandler

  • app.config.errorHandler에 catch하지 않은 에러의 global handler를 할당할 수 있다.
app.config.errorHandler = (err, instance, info) => {
  // handle error, e.g. report to a service
}
  • 핸들링해줄 수 있는 함수들은 다음과 같다.
    • Component renders
    • Event handler
    • Lifecycle hooks
    • setUp() 함수
    • Watchers
    • Coustom directive hooks
    • Transition hooks

참고 자료