Skip to content

Add proper error handling for network and process issues#23

Open
ohtaman wants to merge 2 commits into
mainfrom
feature/18-error-handling
Open

Add proper error handling for network and process issues#23
ohtaman wants to merge 2 commits into
mainfrom
feature/18-error-handling

Conversation

@ohtaman
Copy link
Copy Markdown
Owner

@ohtaman ohtaman commented Jan 14, 2025

Changes Made

This PR implements comprehensive error handling improvements to address the issues outlined in #18:

Network Connectivity

  • Added retry mechanism for server connections
  • Implemented NetworkError exception class
  • Added detailed error messages for connection failures

Port Binding

  • Added retry mechanism for port binding
  • Implemented PortBindingError exception class
  • Added proper logging for binding issues

Process Management

  • Added graceful process termination with timeout
  • Implemented force kill as fallback
  • Added ProcessError exception class
  • Improved cleanup in finally block

General Improvements

  • Created custom exception hierarchy with StreamlitAppError base class
  • Added comprehensive logging throughout
  • Improved documentation with clear error scenarios
  • Added proper error messages for all failure cases

Testing

The changes have been tested for:

  • Network connectivity issues
  • Port binding failures
  • Process termination scenarios
  • Error message clarity

Fixes #18

- Add custom exception hierarchy for better error handling
- Implement retry mechanisms for network connectivity and port binding
- Add graceful process termination with fallback force kill
- Add detailed logging and error messages
- Improve documentation with clear error scenarios

Fixes #18
- Fix process termination to use single join call
- Fix wait_for_server timeout handling
- Fix test by properly mocking time.time()
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.

Add proper error handling for network and process issues

1 participant