code: def handling_errors(self, all_errors_exit=False):
          
          try:
              yield
          except SystemExit as err:
              self.exit(err.code)
          except BaseException:
              etype, value, tb = sys.exc_info()
              for _ in range(num_added_tb_layers):
                  if tb is None:
                      break
                  tb = tb.tb_next
              traceback.print_exception(etype, value, tb)
              if all_errors_exit:
                  self.exit(1)
docs: Handle execution errors.