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

Method _loop_exception_handler

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected