Skip to content

Commit

Permalink
Merge pull request #139 from shreyabiradar07/specify_missing_paramete…
Browse files Browse the repository at this point in the history
…rs_error_msg

Update error message for GET request with missing parameters
  • Loading branch information
dinogun authored Jan 10, 2025
2 parents c2851cb + ed44e19 commit 228c9cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rest_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def do_GET(self):
if re.search(HPOSupportedTypes.API_ENDPOINT, self.path):
query = parse_qs(urlparse(self.path).query)
if "experiment_name" not in query or "trial_number" not in query:
error_msg = HPOErrorConstants.MISSING_PARAMETERS
missing_params = []
if "experiment_name" not in query:
missing_params.append("experiment_name")
if "trial_number" not in query:
missing_params.append("trial_number")
error_msg = HPOErrorConstants.MISSING_PARAMETERS[:-1] + ": " + ", ".join(str(param) for param in missing_params)
logger.error(error_msg)
self._set_response(400, error_msg)
return
Expand Down

0 comments on commit 228c9cf

Please sign in to comment.