diff --git a/lightrag/operate.py b/lightrag/operate.py index 58278ff5..6293591c 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -2179,7 +2179,12 @@ async def extract_entities( async def _process_with_semaphore(chunk): async with semaphore: - return await _process_single_content(chunk) + try: + return await _process_single_content(chunk) + except Exception as e: + chunk_id = chunk[0] # Extract chunk_id from chunk[0] + prefixed_exception = create_prefixed_exception(e, chunk_id) + raise prefixed_exception from e tasks = [] for c in ordered_chunks: