Skip to content

🚨Refactor tmux_utils.py for robust exception-based error handling🚨 #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rixmerz
Copy link

@Rixmerz Rixmerz commented Jul 28, 2025

Changes:

  • get_tmux_sessions(): Now raises TmuxSessionNotFound/TmuxCommandError instead of returning []
  • capture_window_content(): Raises TmuxCaptureError instead of returning error string
  • get_window_info(): Raises specific exceptions instead of returning {'error': '...'}
  • send_keys_to_window(): Raises exceptions instead of returning False
  • send_command_to_window(): Raises exceptions instead of returning False
  • Monitoring functions handle exceptions gracefully for backward compatibility

Closes #13

- Replace print-and-return error patterns with proper Python exceptions
- Add comprehensive exception hierarchy (TmuxError, TmuxSessionNotFound, etc.)
- Maintain backward compatibility for monitoring functions
- Addresses issue Jedward23#13 requirements for structured error communication

Changes:
- get_tmux_sessions(): Now raises TmuxSessionNotFound/TmuxCommandError instead of returning []
- capture_window_content(): Raises TmuxCaptureError instead of returning error string
- get_window_info(): Raises specific exceptions instead of returning {'error': '...'}
- send_keys_to_window(): Raises exceptions instead of returning False
- send_command_to_window(): Raises exceptions instead of returning False
- Monitoring functions handle exceptions gracefully for backward compatibility

Closes Jedward23#13
@Rixmerz Rixmerz changed the title Refactor tmux_utils.py for robust exception-based error handling 🚨Refactor tmux_utils.py for robust exception-based error handling🚨 Jul 28, 2025
@Rixmerz
Copy link
Author

Rixmerz commented Aug 12, 2025

@Jedward23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor tmux_utils.py for Robust, Exception-Based Error Handling
1 participant