diff --git a/src/SlotDbClient.php b/src/SlotDbClient.php index e24e40e..87d6c8e 100644 --- a/src/SlotDbClient.php +++ b/src/SlotDbClient.php @@ -50,6 +50,9 @@ class SlotDbClient public function querySlot(string $slotId): array { $res = $this->get("/slot/{$slotId}"); + if ($res->getStatusCode() == 404) { + throw new \RuntimeException("Invalid slot id"); + } $data = json_decode($res->getBody(), true); return $data; } @@ -119,6 +122,9 @@ class SlotDbClient public function queryGroup(string $groupId): array { $res = $this->get("/group/{$groupId}"); + if ($res->getStatusCode() == 404) { + throw new \RuntimeException("Invalid group id"); + } $data = json_decode($res->getBody(), true); return $data; }