Coverage for src/qdrant_loader/cli/commands/init.py: 92%

12 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-08 06:05 +0000

1from __future__ import annotations 

2 

3from click.exceptions import ClickException 

4 

5 

6async def run_init(settings, force: bool) -> None: 

7 from qdrant_loader.core.init_collection import init_collection 

8 

9 try: 

10 result = await init_collection(settings, force) 

11 except ClickException: 

12 raise 

13 except Exception as e: 

14 raise ClickException(f"Failed to initialize collection: {e}") from e 

15 if result is False: 

16 raise ClickException("Failed to initialize collection")