Add error handling with chunk ID prefixing in entity extraction
This commit is contained in:
parent
5f45ff56be
commit
ecaee43788
1 changed files with 6 additions and 1 deletions
|
|
@ -2179,7 +2179,12 @@ async def extract_entities(
|
||||||
|
|
||||||
async def _process_with_semaphore(chunk):
|
async def _process_with_semaphore(chunk):
|
||||||
async with semaphore:
|
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 = []
|
tasks = []
|
||||||
for c in ordered_chunks:
|
for c in ordered_chunks:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue