Skip to content

Commit 93b3113

Browse files
committed
Catch UnsuprtedRepositoryException
1 parent 4abdcf6 commit 93b3113

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PHPCR/Shell/Subscriber/ExceptionSubscriber.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPCR\Shell\Event\CommandExceptionEvent;
77
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
88
use PHPCR\Shell\Event\PhpcrShellEvents;
9+
use PHPCR\UnsupportedRepositoryOperationException;
910

1011
/**
1112
* Try and better handle exceptions
@@ -26,6 +27,10 @@ public function handleException(CommandExceptionEvent $event)
2627
$exception = $event->getException();
2728
$output = $event->getOutput();
2829

30+
if ($exception instanceof UnsupportedRepositoryOperationException) {
31+
$output->writeln('<error>Unsupported repository operation: This repository is not capable of performing the requested action</error>');
32+
}
33+
2934
if ($exception instanceof NotImplementedException) {
3035
$output->writeln('<error>Not implemented: ' . $exception->getMessage() . '</error>');
3136
}

0 commit comments

Comments
 (0)