Claude Code commited on
Commit
86389f0
·
1 Parent(s): 8bb095e

fix: add error handling to toggle_system_status

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -343,10 +343,14 @@ def reset_session():
343
 
344
  def toggle_system_status() -> tuple[bool, str]:
345
  """Toggle system status visibility."""
346
- global _system_status_visible
347
- _system_status_visible = not _system_status_visible
348
- status_text = "✅ System details shown" if _system_status_visible else "🔒 System details hidden"
349
- return _system_status_visible, status_text
 
 
 
 
350
 
351
 
352
  def export_chat(history: list, format_type: str = "txt") -> str:
 
343
 
344
  def toggle_system_status() -> tuple[bool, str]:
345
  """Toggle system status visibility."""
346
+ try:
347
+ global _system_status_visible
348
+ _system_status_visible = not _system_status_visible
349
+ status_text = "✅ System details shown" if _system_status_visible else "🔒 System details hidden"
350
+ return _system_status_visible, status_text
351
+ except Exception as e:
352
+ logger.error(f"[TOGGLE_ERROR] Failed to toggle status: {e}")
353
+ return False, f"Error: {e}"
354
 
355
 
356
  def export_chat(history: list, format_type: str = "txt") -> str: