def err_handler(exc): if (isinstance(exc, apptest.exception.RemoteException) and "INJECT_EVENTS" in exc.msg): return if isinstance(exc, apptest.exception.StoppedException): return log.record_exception(dev, exc, ins_path, launcher, args.device_conf)
def record_exception(self, e): log.record_exception(self.launcher.dev, e, self.ins_path, self.launcher, self.launcher.device_conf)
op = result[2+i] print "Available operation %d: %s" % (i, base64.b64decode(op)) except Exception as e: logger.error("got exception: %r" % e) if isinstance(e, apptest.exception.ConnectionBroken): logger.error("connection broken") break elif bugname == "kpd183": raw_input() if args.wait_before_exit: raw_input("press enter to exit") except apptest.exception.ConnectionBroken as e: logger.error("connection broken: %r" % e) log.record_exception(dev, e, ins_path, launcher, args.device_conf) except Exception as e: logger.error("exception occoured: %r" % e) traceback.print_exc() finally: #apptest.init.finish() dev.get_recent_logcat() launcher.cleanup() dev.cleanup() logger.info("=== activities created / total: %d/%d" % (len(activity_created), len(activity_total))) logger.info("=== activities created:") for act in activity_created: logger.info("=== - %s" % act)