diff options
Diffstat (limited to 'lib/Service/LogService.php')
-rw-r--r-- | lib/Service/LogService.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Service/LogService.php b/lib/Service/LogService.php index e4bef90a..78ad090a 100644 --- a/lib/Service/LogService.php +++ b/lib/Service/LogService.php @@ -23,6 +23,7 @@ namespace OCA\Polls\Service; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; use OCP\DB\Exception; use OCA\Polls\Db\Log; use OCA\Polls\Db\LogMapper; @@ -57,6 +58,9 @@ class LogService { try { return $this->logMapper->insert($this->log); + } catch (UniqueConstraintViolationException $e) { + // deprecated NC22 + return null; } catch (Exception $e) { if ($e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) { return null; |