Updated CLI commands to just print exception messages when possible

This commit is contained in:
Alejandro Celaya
2019-11-28 18:42:27 +01:00
parent d83d2f82bd
commit 5055ddf995
14 changed files with 40 additions and 97 deletions

View File

@@ -65,7 +65,7 @@ class ResolveUrlCommand extends Command
$output->writeln(sprintf('Long URL: <info>%s</info>', $url->getLongUrl()));
return ExitCodes::EXIT_SUCCESS;
} catch (ShortUrlNotFoundException $e) {
$io->error(sprintf('Provided short code "%s" could not be found.', $shortCode));
$io->error($e->getMessage());
return ExitCodes::EXIT_FAILURE;
}
}