Skip to content

Commit

Permalink
fix: correct failure message on groupe not found
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoheiser committed Jan 9, 2025
1 parent 64e8556 commit 56c2263
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions moto/scheduler/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def __init__(self, name: str) -> None:
class ScheduleGroupNotFound(JsonRESTError):
code = 404

def __init__(self) -> None:
super().__init__("ResourceNotFoundException", "ScheduleGroup not found")
def __init__(self, name: str) -> None:
super().__init__(
"ResourceNotFoundException", f"Schedule group {name} does not exist."
)


class ValidationException(JsonRESTError):
Expand Down
2 changes: 1 addition & 1 deletion moto/scheduler/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def create_schedule_group(

def get_schedule_group(self, group_name: Optional[str]) -> ScheduleGroup:
if (group_name or "default") not in self.schedule_groups:
raise ScheduleGroupNotFound
raise ScheduleGroupNotFound(group_name or "default")
return self.schedule_groups[group_name or "default"]

def list_schedule_groups(self) -> Iterable[ScheduleGroup]:
Expand Down

0 comments on commit 56c2263

Please sign in to comment.