diff --git a/app/routers/chargepoint_v1.py b/app/routers/chargepoint_v1.py index 1dfdd00..2b2031b 100644 --- a/app/routers/chargepoint_v1.py +++ b/app/routers/chargepoint_v1.py @@ -130,9 +130,12 @@ async def reset_chargepoint( api_key: str = Security(get_api_key) ): if chargepoint_manager.is_connected(chargepoint_id) == False: - raise HTTPException(status_code=423, detail="Chargepoint not connected") - response = await chargepoint_manager.call( - chargepoint_id, - payload=ResetPayload(type=reset_request.type, evse_id=reset_request.evse_id) - ) - return ChargePointResetResponse(status=response.status) + raise HTTPException(status_code=503, detail="Chargepoint not connected.") + try: + response = await chargepoint_manager.call( + chargepoint_id, + payload=ResetPayload(type=reset_request.type, evse_id=reset_request.evse_id) + ) + return ChargePointResetResponse(status=response.status) + except TimeoutError: + raise HTTPException(status_code=503, detail="Chargepoint didn't respond in time.")