Skip to content

Commit fbd1a63

Browse files
committed
catch exceptions when calling remote APIs in the background
1 parent f810fd0 commit fbd1a63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rasenmaeher_api/prodcutapihelpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ async def _method_to_all_products(
8484
async def handle_one(name: str) -> Tuple[str, Optional[pydantic.BaseModel]]:
8585
"""Do one call"""
8686
nonlocal url_suffix, methodname, respose_schema, data
87-
return name, await _method_to_product(name, methodname, url_suffix, data, respose_schema)
87+
try:
88+
return name, await _method_to_product(name, methodname, url_suffix, data, respose_schema)
89+
except Exception as exc: # pylint: disable=W0718
90+
LOGGER.exception(exc)
91+
return name, None
8892

8993
if not collect_responses:
9094
tma = TaskMaster.singleton()

0 commit comments

Comments
 (0)