fix: Remove outer try-catch block from signals endpoint

- Removed the outer try-catch block that was catching HTTPException
- HTTPException now properly propagates to FastAPI error handler
- This ensures clear error messages are returned when protocol servers are disabled
This commit is contained in:
openhands 2025-11-01 16:35:56 +00:00
parent 28bf3ab246
commit ce08cf846d
1 changed files with 108 additions and 113 deletions

View File

@ -601,7 +601,6 @@ async def _generate_mock_signals(stations: Dict, pumps_by_station: Dict) -> List
@dashboard_router.get("/signals")
async def get_signals():
"""Get overview of all active signals across protocols"""
try:
# Use default stations and pumps since we don't have db access in this context
stations = {
"STATION_001": {"name": "Main Pump Station", "location": "Downtown"},
@ -720,10 +719,6 @@ async def get_signals():
"last_updated": datetime.now().isoformat()
}
except Exception as e:
logger.error(f"Error getting signals: {str(e)}")
raise HTTPException(status_code=500, detail=f"Failed to get signals: {str(e)}")
@dashboard_router.get("/signals/export")
async def export_signals():
"""Export signals to CSV format"""