diff --git a/python/ray/dashboard/state_api_utils.py b/python/ray/dashboard/state_api_utils.py index 8ffafa7badb3..30240d9aba10 100644 --- a/python/ray/dashboard/state_api_utils.py +++ b/python/ray/dashboard/state_api_utils.py @@ -44,6 +44,8 @@ async def handle_list_api( error_message="", result=asdict(result), ) + except ValueError as e: + return do_reply(success=False, error_message=str(e), result=None) except DataSourceUnavailable as e: return do_reply(success=False, error_message=str(e), result=None) @@ -70,7 +72,9 @@ def options_from_req(req: aiohttp.web.Request) -> ListApiOptions: if limit > RAY_MAX_LIMIT_FROM_API_SERVER: raise ValueError( f"Given limit {limit} exceeds the supported " - f"limit {RAY_MAX_LIMIT_FROM_API_SERVER}. Use a lower limit." + f"Given limit {limit} exceeds the supported " + f"limit {RAY_MAX_LIMIT_FROM_API_SERVER}. Use a lower limit, or set the " + f"`RAY_MAX_LIMIT_FROM_API_SERVER` environment variable to a larger value." ) timeout = int(req.query.get("timeout", 30))