(self, loop, context)
| 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: |
nothing calls this directly
no test coverage detected