Skip to content

Bug Fix: Error Handling for Disconnected Stations#176

Merged
Manjushwarofficial merged 5 commits intoOpenFlow-X:mainfrom
shupandee:main
Oct 26, 2025
Merged

Bug Fix: Error Handling for Disconnected Stations#176
Manjushwarofficial merged 5 commits intoOpenFlow-X:mainfrom
shupandee:main

Conversation

@shupandee
Copy link
Contributor

@shupandee shupandee commented Oct 24, 2025

📋 Issue

Fixes #172

🔧 Changes Made

  • Added comprehensive error handling for nx.shortest_path() and nx.shortest_path_length()
  • Implemented specific exception handling for NetworkXNoPath, KeyError, and generic exceptions
  • Added network connectivity status indicator in sidebar
  • Improved user feedback with actionable error messages
  • Removed redundant np.random.seed(None) call
  • Added code comments for better maintainability

✅ Testing Done

  • Tested with connected stations - works correctly
  • Tested with same start/end - shows warning
  • Tested error scenarios - displays proper messages
  • Verified app stability - no crashes
  • Checked network status indicator - functioning

📸 Screenshots

Before:

Screenshot 2025-10-24 193052

after :

after

🏷️ Labels

hacktoberfest, hacktoberfest-accepted, bug-fix, gssoc

👤 Contributor

@shupandee

 Key Changes Made:
1. Added Comprehensive Error Handling (Lines 94-153)
✅ try-except block wrapping all route planning logic
✅ Specific handling for nx.NetworkXNoPath exception
✅ Handling for KeyError (station not in graph)
✅ Generic exception handler as safety net
2. Improved User Feedback
✅ Clear error messages explaining what went wrong
✅ Actionable suggestions for users
✅ Shows reachable stations from selected start point
3. Network Status Indicator (Lines 80-85)
✅ Added sidebar connectivity check
✅ Visual indicator of network health
4. Code Quality Improvements
✅ Removed redundant np.random.seed(None) (Line 72)
✅ Added comments explaining the travel time formula
✅ Better code organization
@github-actions
Copy link

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them 🙌🏼.

@Manjushwarofficial Manjushwarofficial merged commit 6830469 into OpenFlow-X:main Oct 26, 2025
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.

Critical Error Handling Missing for Disconnected Metro Stations

2 participants