Handle queries for missing slot/group ids
This commit is contained in:
parent
5247410218
commit
33b96007e8
2
Makefile
2
Makefile
@ -14,5 +14,5 @@ phar:
|
||||
mv bin/slotcli.phar ./slotcli.phar
|
||||
|
||||
deb:
|
||||
dpack build --type deb
|
||||
fakeroot -- dpack build --type deb
|
||||
|
||||
|
4
composer.lock
generated
4
composer.lock
generated
@ -594,7 +594,7 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "../slotdb-client-php",
|
||||
"reference": "c85e36f1cb035b2f854bfe01b03da739d5decf66"
|
||||
"reference": "4734ca5fe4ed02da5bc3e0df3c9ecbabc3474af3"
|
||||
},
|
||||
"require": {
|
||||
"psr/http-client": "^1.0"
|
||||
@ -620,7 +620,7 @@
|
||||
}
|
||||
],
|
||||
"description": "SlotDB PHP Client",
|
||||
"time": "2025-03-14T00:36:19+00:00"
|
||||
"time": "2025-03-14T14:34:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
|
@ -29,7 +29,12 @@ class GroupQueryCommand extends Command
|
||||
{
|
||||
$groupId = $input->getArgument("group");
|
||||
|
||||
$group = $this->client->queryGroup($groupId);
|
||||
try {
|
||||
$group = $this->client->queryGroup($groupId);
|
||||
} catch (\RuntimeException $e) {
|
||||
$output->writeln("<error>Invalid group id: {$slotId}</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
$len = 2 + max(array_map(mb_strlen(...), array_keys($group)));
|
||||
|
||||
|
@ -30,7 +30,12 @@ class SlotQueryCommand extends Command
|
||||
{
|
||||
|
||||
$slotId = $input->getArgument("slot");
|
||||
$slot = $this->client->querySlot($slotId);
|
||||
try {
|
||||
$slot = $this->client->querySlot($slotId);
|
||||
} catch (\RuntimeException $e) {
|
||||
$output->writeln("<error>Invalid slot id: {$slotId}</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
$len = 2 + max(array_map(mb_strlen(...), array_keys($slot)));
|
||||
foreach ($slot as $k=>$v) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user