mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 08:16:43 -04:00
Revert "[stable21] Fix constraint violation detection in QB Mapper"
This commit is contained in:
parent
e76b83393c
commit
affe97235d
1 changed files with 3 additions and 6 deletions
|
|
@ -30,7 +30,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace OCP\AppFramework\Db;
|
||||
|
||||
use OCP\DB\Exception;
|
||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
|
|
@ -162,11 +162,8 @@ abstract class QBMapper {
|
|||
public function insertOrUpdate(Entity $entity): Entity {
|
||||
try {
|
||||
return $this->insert($entity);
|
||||
} catch (Exception $ex) {
|
||||
if ($ex->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
|
||||
return $this->update($entity);
|
||||
}
|
||||
throw $ex;
|
||||
} catch (UniqueConstraintViolationException $ex) {
|
||||
return $this->update($entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue