Skip to content

Commit

Permalink
Fix user cli update command handling of not existing user ids
Browse files Browse the repository at this point in the history
  • Loading branch information
leepeuker committed Aug 17, 2022
1 parent 569b41a commit 821c83b
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 821c83b

Please sign in to comment.