MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / _loop_exception_handler

Method _loop_exception_handler

octobot/task_manager.py:166–174  ·  view source on GitHub ↗
(self, loop, context)

Source from the content-addressed store, hash-verified

164 self.executors = thread.ThreadPoolExecutor(max_workers=workers)
165
166 def _loop_exception_handler(self, loop, context):
167 loop_str = "bot main async" if loop is self.async_loop else {loop}
168 message = f"Error in {loop_str} loop: {context}"
169 function = self.logger.debug if self._should_use_debug_for_message(message) else self.logger.warning
170 exception = context.get('exception')
171 if exception is not None:
172 formatted_traceback = "\n".join(traceback.format_tb(exception.__traceback__))
173 message = f"{message}:\n{formatted_traceback}"
174 function(message)
175
176 @staticmethod
177 def _should_use_debug_for_message(message: str) -> bool:

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected