def _exception_handler(e): user_system_log.exception(_(u"strategy execute exception")) user_system_log.error(e.error) if not is_user_exc(e.error.exc_val): return const.EXIT_CODE.EXIT_INTERNAL_ERROR return const.EXIT_CODE.EXIT_USER_ERROR
def _exception_handler(e): better_exceptions.excepthook(e.error.exc_type, e.error.exc_val, e.error.exc_tb) user_system_log.error(e.error) if not is_user_exc(e.error.exc_val): code = const.EXIT_CODE.EXIT_INTERNAL_ERROR system_log.exception(_(u"strategy execute exception")) else: code = const.EXIT_CODE.EXIT_USER_ERROR user_detail_log.exception(_(u"strategy execute exception")) return code
def _exception_handler(e): try: sys.excepthook(e.error.exc_type, e.error.exc_val, e.error.exc_tb) except Exception as e: system_log.exception("hook exception failed") user_system_log.error(e.error) if not is_user_exc(e.error.exc_val): code = const.EXIT_CODE.EXIT_INTERNAL_ERROR system_log.error(_(u"strategy execute exception"), exc=e) else: code = const.EXIT_CODE.EXIT_USER_ERROR user_detail_log.error(_(u"strategy execute exception"), exc=e) return code
def _exception_handler(e): try: sys.excepthook(e.error.exc_type, e.error.exc_val, e.error.exc_tb) except Exception as e: system_log.exception("hook exception failed") user_system_log.error(e.error) if not is_user_exc(e.error.exc_val): code = const.EXIT_CODE.EXIT_INTERNAL_ERROR system_log.error(_(u"strategy execute exception"), exc=e) else: code = const.EXIT_CODE.EXIT_USER_ERROR user_detail_log.error(_(u"strategy execute exception"), exc=e) return code
def cancel_order(self, order): user_system_log.error(_(u"cancel_order function is not supported in signal mode")) return None
def cancel_order(self, order): user_system_log.error( _(u"cancel_order function is not supported in signal mode")) return None