Skip to content

Commit bf7648c

Browse files
committed
improve excpeiton message
1 parent 937bf3e commit bf7648c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/PostRector/Application/PostFileProcessor.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ private function sortByPriority(array $postRectors): array
6464

6565
foreach ($postRectors as $postRector) {
6666
if (isset($postRectorsByPriority[$postRector->getPriority()])) {
67-
throw new ShouldNotHappenException();
67+
$errorMessage = sprintf(
68+
'There are multiple post rectors with the same priority: %d. Use different one for your new PostRector',
69+
$postRector->getPriority()
70+
);
71+
72+
throw new ShouldNotHappenException($errorMessage);
6873
}
6974

7075
$postRectorsByPriority[$postRector->getPriority()] = $postRector;

0 commit comments

Comments
 (0)