Skip to content

Commit

Permalink
Merge pull request #624 from tienvx/dont-show-error-cant-connect-step…
Browse files Browse the repository at this point in the history
…s-while-reducing-it

Don't show error can't connect steps while reducing it
  • Loading branch information
tienvx committed May 6, 2022
2 parents 831712c + d5158e8 commit f83e41d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Service/Step/Builder/ShortestPathStepsBuilder.php
Expand Up @@ -4,9 +4,9 @@

use Generator;
use JMGQ\AStar\AStar;
use RuntimeException;
use SingleColorPetrinet\Model\PetrinetInterface;
use SingleColorPetrinet\Service\GuardedTransitionServiceInterface;
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Tienvx\Bundle\MbtBundle\Exception\ExceptionInterface;
use Tienvx\Bundle\MbtBundle\Exception\OutOfRangeException;
use Tienvx\Bundle\MbtBundle\Model\Bug\Step;
Expand Down Expand Up @@ -69,7 +69,7 @@ protected function getRemainingSteps(array $steps, StepInterface $lastStep, Petr
}
$transition = $petrinet->getTransitionById($step->getTransition());
if (!$this->transitionService->isEnabled($transition, $marking)) {
throw new RuntimeException('Can not connect remaining steps');
throw new UnrecoverableMessageHandlingException('Can not connect remaining steps');
}
$this->transitionService->fire($transition, $marking);
yield new Step(
Expand Down
4 changes: 2 additions & 2 deletions tests/Service/Step/Builder/ShortestPathStepsBuilderTest.php
Expand Up @@ -7,7 +7,6 @@
use Petrinet\Model\TransitionInterface;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use SingleColorPetrinet\Builder\SingleColorPetrinetBuilder;
use SingleColorPetrinet\Model\Color;
use SingleColorPetrinet\Model\ColorfulFactory;
Expand All @@ -16,6 +15,7 @@
use SingleColorPetrinet\Model\PetrinetInterface;
use SingleColorPetrinet\Service\GuardedTransitionService;
use SingleColorPetrinet\Service\GuardedTransitionServiceInterface;
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Entity\Model\Revision;
use Tienvx\Bundle\MbtBundle\Entity\Task;
Expand Down Expand Up @@ -294,7 +294,7 @@ public function testGetShortestPathBetweenSameSteps(): void
public function testGetShortestPathFromCartEmptyToFourProductsInCart(): void
{
$this->expectsPetrinetHelper();
$this->expectExceptionObject(new RuntimeException('Can not connect remaining steps'));
$this->expectExceptionObject(new UnrecoverableMessageHandlingException('Can not connect remaining steps'));
iterator_to_array($this->stepsBuilder->create($this->bug, 0, 6));
}

Expand Down

0 comments on commit f83e41d

Please sign in to comment.