Merge pull request #2304 from ChrisJr404/surface-work-item-errors

fix(worker): surface the underlying exception when a work item fails (#2227)
This commit is contained in:
J.Townsend
2026-05-10 03:46:35 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -39,6 +39,6 @@ class TestShodanEngine:
assert excinfo.value.code == 0
out = capsys.readouterr().out
assert 'A error occurred while processing a "work item"' not in out
assert 'An error occurred while processing a "work item"' not in out
assert "a.example.com" in out
assert "b.example.com" in out
+2 -2
View File
@@ -1312,8 +1312,8 @@ async def start(rest_args: argparse.Namespace | None = None):
await stor
queue.task_done()
# Notify the queue that the "work item" has been processed.
except Exception:
print('\n A error occurred while processing a "work item".\n')
except Exception as work_item_error:
print(f'\n An error occurred while processing a "work item": {type(work_item_error).__name__}: {work_item_error}\n')
queue.task_done()
async def handler(lst):