Skip to content

Commit d93bfa7

Browse files
fix: replace bare except clauses with except Exception
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit. Replaced 4 instances with `except Exception:`.
1 parent 1f2f083 commit d93bfa7

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/biz_layer/mem_db_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _convert_timestamp_to_time(
143143
try:
144144
dt = from_iso_format(timestamp)
145145
return to_iso_format(dt)
146-
except:
146+
except Exception:
147147
# If parsing fails, return string directly
148148
return timestamp
149149
else:

src/infra_layer/adapters/out/search/repository/episodic_memory_milvus_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def create_and_save_episodic_memory(
124124
metadata_json = metadata
125125
try:
126126
metadata_dict = json.loads(metadata)
127-
except:
127+
except Exception:
128128
metadata_dict = {}
129129

130130
# Prepare entity data

tests/test_conv_memcell_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_llm_provider() -> LLMProvider:
3737
try:
3838
# Try to get from DI container
3939
return get_bean_by_type(LLMProvider)
40-
except:
40+
except Exception:
4141
# If not found in DI container, create directly
4242
logger.info("LLMProvider not found in DI container, creating directly...")
4343
return LLMProvider("openai")

tests/test_group_user_profile_memory_raw_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ async def test_batch_get_by_user_groups():
528528
for user_id, group_id, _ in test_data:
529529
try:
530530
await repo.delete_by_user_group(user_id, group_id)
531-
except:
531+
except Exception:
532532
pass
533533
raise
534534

0 commit comments

Comments
 (0)