@@ -52,7 +52,7 @@ def read_activities_from_db(username: str | None = None) -> List[Tuple[str, str]
5252 activity_list = activities_helper .read_activities (username )
5353 for activity in activity_list :
5454 result .append ((activity ["id" ], activity ["activity" ]))
55- except ( ConnectionError , ValueError , KeyError ) as e :
55+ except Exception as e :
5656 logger .error ("Error reading activities: %s" , e )
5757 return result
5858
@@ -88,7 +88,7 @@ def index():
8888 # Append the activity to the in-memory list
8989 activities .append ((inserted_activity ["id" ], inserted_activity ["activity" ]))
9090 logger .info (f"Activity created: { inserted_activity ['id' ]} " )
91- except ( ConnectionError , ValueError ) as e :
91+ except Exception as e :
9292 logger .error ("Error creating/updating activity: %s" , e )
9393
9494 return redirect (url_for ('index' ))
@@ -117,7 +117,7 @@ def delete(activity_id: int):
117117 logger .info (f"Activity deleted: { db_activity_id } " )
118118 else :
119119 logger .warning (f"No activity found with ID: { db_activity_id } " )
120- except ( ConnectionError , ValueError ) as e :
120+ except Exception as e :
121121 logger .error ("Error deleting activity: %s" , e )
122122
123123 return redirect (url_for ('index' ))
0 commit comments