<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error_catcher(self, extra_info: Optional[str] = None):
 """ Context manager to catch, print and record InstaloaderExceptions. :param extra_info: String to prefix error message with."""

        try:
            yield
        except InstaloaderException as err:
            if extra_info:
                self.error('{}: {}'.format(extra_info, err))
            else:
                self.error('{}'.format(err))
            if self.raise_all_errors:
                raise