this exception will not be thrown anymore
This commit is contained in:
parent
bf8fee14e3
commit
e8bdb3d345
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
namespace OCA\GPodderSync\Core\EpisodeAction;
|
namespace OCA\GPodderSync\Core\EpisodeAction;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
|
||||||
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionEntity;
|
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionEntity;
|
||||||
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionRepository;
|
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionRepository;
|
||||||
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionWriter;
|
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionWriter;
|
||||||
|
@ -41,8 +40,6 @@ class EpisodeActionSaver
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$episodeActionEntities[] = $this->episodeActionWriter->save($episodeActionEntity);
|
$episodeActionEntities[] = $this->episodeActionWriter->save($episodeActionEntity);
|
||||||
} catch (UniqueConstraintViolationException $uniqueConstraintViolationException) {
|
|
||||||
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||||
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
$episodeActionEntities[] = $this->updateEpisodeAction($episodeActionEntity, $userId);
|
||||||
|
@ -71,8 +68,6 @@ class EpisodeActionSaver
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->episodeActionWriter->update($episodeActionEntity);
|
return $this->episodeActionWriter->update($episodeActionEntity);
|
||||||
} catch (UniqueConstraintViolationException $uniqueConstraintViolationException) {
|
|
||||||
$this->deleteConflictingEpisodeAction($episodeActionEntity, $userId);
|
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
if ($exception->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||||
$this->deleteConflictingEpisodeAction($episodeActionEntity, $userId);
|
$this->deleteConflictingEpisodeAction($episodeActionEntity, $userId);
|
||||||
|
|
Loading…
Reference in New Issue