Skip to content

Commit ed44e19

Browse files
Update error message for GET request with missing parameters
Signed-off-by: Shreya <[email protected]>
1 parent d7e024e commit ed44e19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rest_service.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ def do_GET(self):
100100
if re.search(HPOSupportedTypes.API_ENDPOINT, self.path):
101101
query = parse_qs(urlparse(self.path).query)
102102
if "experiment_name" not in query or "trial_number" not in query:
103-
error_msg = HPOErrorConstants.MISSING_PARAMETERS
103+
missing_params = []
104+
if "experiment_name" not in query:
105+
missing_params.append("experiment_name")
106+
if "trial_number" not in query:
107+
missing_params.append("trial_number")
108+
error_msg = HPOErrorConstants.MISSING_PARAMETERS[:-1] + ": " + ", ".join(str(param) for param in missing_params)
104109
logger.error(error_msg)
105110
self._set_response(400, error_msg)
106111
return

0 commit comments

Comments
 (0)