Vue · Middle · Question 47 of 75
How do you catch errors from descendant components?
- ✓Correct answer: With
onErrorCapturedin an ancestor, or globally withapp.config.errorHandler - 2With
try/catcharound the template - 3Errors in children can't be caught
Explanation
onErrorCaptured can show a fallback UI and return false to stop propagation. app.config.errorHandler is the place to report errors to monitoring.