From 8ec205c0a4e1b6dba2c730c4fa457b746d940b3d Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Thu, 18 Jul 2013 13:34:40 +0200 Subject: [PATCH] rethrow exception so that users can get a stack trace via --verbose --- src/PHPCR/Util/Console/Command/NodeDumpCommand.php | 3 ++- .../Util/Console/Command/NodeTypeRegisterCommand.php | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/PHPCR/Util/Console/Command/NodeDumpCommand.php b/src/PHPCR/Util/Console/Command/NodeDumpCommand.php index fb2149e..aaf57ce 100644 --- a/src/PHPCR/Util/Console/Command/NodeDumpCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeDumpCommand.php @@ -105,8 +105,9 @@ protected function execute(InputInterface $input, OutputInterface $output) } catch (RepositoryException $e) { if ($e instanceof PathNotFoundException || $e instanceof ItemNotFoundException) { $output->writeln("Path '$identifier' does not exist"); + } else { + throw $e; } - $output->writeln('Error: '.$e->getMessage().''); return 1; } diff --git a/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php b/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php index f969aba..01ec198 100644 --- a/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php +++ b/src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php @@ -93,13 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $allowUpdate = $input->getOption('allow-update'); $session = $this->getPhpcrSession(); - try { - $this->updateFromCnd($output, $session, $cnd, $allowUpdate); - } catch (\Exception $e) { - $output->writeln(''.$e->getMessage().''); - - return 1; - } + $this->updateFromCnd($output, $session, $cnd, $allowUpdate); $output->write(PHP_EOL.sprintf('Successfully registered node types from "%s"', $cnd_file) . PHP_EOL);