-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4965 from neos/rebaseFailedException
Rebase failed exception
- Loading branch information
Showing
13 changed files
with
202 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
....ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandThatFailedDuringRebase.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Neos.ContentRepository package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase; | ||
|
||
use Neos\ContentRepository\Core\CommandHandler\CommandInterface; | ||
|
||
/** | ||
* @internal implementation detail of WorkspaceCommandHandler | ||
*/ | ||
final readonly class CommandThatFailedDuringRebase | ||
{ | ||
/** | ||
* @param int $sequenceNumber the event store sequence number of the event containing the command to be rebased | ||
* @param CommandInterface $command the command that failed | ||
* @param \Throwable $exception how the command failed | ||
*/ | ||
public function __construct( | ||
public int $sequenceNumber, | ||
public CommandInterface $command, | ||
public \Throwable $exception | ||
) { | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandsThatFailedDuringRebase.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Neos.ContentRepository.Core package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase; | ||
|
||
/** | ||
* @implements \IteratorAggregate<int,CommandThatFailedDuringRebase> | ||
* | ||
* @api part of the exception exposed when rebasing failed | ||
*/ | ||
final readonly class CommandsThatFailedDuringRebase implements \IteratorAggregate | ||
{ | ||
/** | ||
* @var array<int,CommandThatFailedDuringRebase> | ||
*/ | ||
private array $items; | ||
|
||
public function __construct(CommandThatFailedDuringRebase ...$items) | ||
{ | ||
$this->items = array_values($items); | ||
} | ||
|
||
public function add(CommandThatFailedDuringRebase $item): self | ||
{ | ||
$items = $this->items; | ||
$items[] = $item; | ||
|
||
return new self(...$items); | ||
} | ||
|
||
public function isEmpty(): bool | ||
{ | ||
return $this->items === []; | ||
} | ||
|
||
/** | ||
* @return \Traversable<int,CommandThatFailedDuringRebase> | ||
*/ | ||
public function getIterator(): \Traversable | ||
{ | ||
yield from $this->items; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ontentRepository.Core/Classes/Feature/WorkspaceRebase/Exception/WorkspaceRebaseFailed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Neos.ContentRepository.Core package. | ||
* | ||
* (c) Contributors of the Neos Project - www.neos.io | ||
* | ||
* This package is Open Source Software. For the full copyright and license | ||
* information, please view the LICENSE file which was distributed with this | ||
* source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase\Exception; | ||
|
||
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\CommandsThatFailedDuringRebase; | ||
|
||
/** | ||
* @api this exception contains information about what exactly went wrong during rebase | ||
*/ | ||
final class WorkspaceRebaseFailed extends \Exception | ||
{ | ||
public function __construct( | ||
public readonly CommandsThatFailedDuringRebase $commandsThatFailedDuringRebase, | ||
string $message = "", | ||
int $code = 0, | ||
?\Throwable $previous = null | ||
) { | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
59 changes: 0 additions & 59 deletions
59
Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/WorkspaceRebaseStatistics.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.