Skip to content

Commit

Permalink
Merge pull request #103 from leepeuker/hotfix
Browse files Browse the repository at this point in the history
Fix user cli update command handling of not existing user ids
  • Loading branch information
leepeuker authored Aug 17, 2022
2 parents 569b41a + 821c83b commit dad13a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Command/UserUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ protected function execute(InputInterface $input, OutputInterface $output) : int
{
$userId = (int)$input->getArgument('userId');

try {
$this->userApi->fetchUser($userId);
} catch (\RuntimeException $e) {
$this->generateOutput($output, 'User id does not exist: ' . $userId);

return Command::FAILURE;
}

try {
$email = $input->getOption('email');
if ($email !== null) {
Expand Down

0 comments on commit dad13a4

Please sign in to comment.