(exc_group: BaseExceptionGroup[Exception])
| 94 | |
| 95 | async def _startup(self): |
| 96 | def handle_exception(exc_group: BaseExceptionGroup[Exception]) -> None: |
| 97 | self.should_exit.set() |
| 98 | |
| 99 | for exc in flatten_exception_group(exc_group): |
| 100 | logger.opt(colors=True, exception=exc).error( |
| 101 | "<r><bg #f8bbd0>Error occurred while running startup hook." |
| 102 | "</bg #f8bbd0></r>" |
| 103 | ) |
| 104 | logger.error( |
| 105 | "<r><bg #f8bbd0>Application startup failed. Exiting.</bg #f8bbd0></r>" |
| 106 | ) |
| 107 | |
| 108 | with catch({Exception: handle_exception}): |
| 109 | await self._lifespan.startup() |
nothing calls this directly
no test coverage detected