Error boundary components are just React components that implement the componentDidCatch life cycle method to catch errors in their children. They catch errors in constructor methods when a class component is initialized but fails, in life cycle methods, and while rendering. Errors that cannot be caught are from asynchronous code, event handlers, and errors in the error component boundary itself.
The componentDidCatch life cycle method receives two arguments: the first one is an error object while the second received argument is an object containing a componentStack property with a friendly stack trace that describes where in the React tree a component failed.