Skip to content

Commit 37f2843

Browse files
committed
Merge pull request #84 from phpcr/rethrow_command_exception
rethrow exception so that users can get a stack trace via --verbose
2 parents 78fee59 + 8ec205c commit 37f2843

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/PHPCR/Util/Console/Command/NodeDumpCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
105105
} catch (RepositoryException $e) {
106106
if ($e instanceof PathNotFoundException || $e instanceof ItemNotFoundException) {
107107
$output->writeln("<error>Path '$identifier' does not exist</error>");
108+
} else {
109+
throw $e;
108110
}
109-
$output->writeln('<error>Error: '.$e->getMessage().'</error>');
110111

111112
return 1;
112113
}

src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9393
$allowUpdate = $input->getOption('allow-update');
9494
$session = $this->getPhpcrSession();
9595

96-
try {
97-
$this->updateFromCnd($output, $session, $cnd, $allowUpdate);
98-
} catch (\Exception $e) {
99-
$output->writeln('<error>'.$e->getMessage().'</error>');
100-
101-
return 1;
102-
}
96+
$this->updateFromCnd($output, $session, $cnd, $allowUpdate);
10397

10498
$output->write(PHP_EOL.sprintf('Successfully registered node types from "<info>%s</info>"', $cnd_file) . PHP_EOL);
10599

0 commit comments

Comments
 (0)