From 614c6fbdba56f0c5829a306aa038e1911882a94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 29 Apr 2022 15:45:07 +0200 Subject: [PATCH] Handle qb mapper exception messages properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Db/AttachmentMapper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Db/AttachmentMapper.php b/lib/Db/AttachmentMapper.php index 46e63f7c4..b78c47899 100644 --- a/lib/Db/AttachmentMapper.php +++ b/lib/Db/AttachmentMapper.php @@ -67,13 +67,13 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper { $row = $cursor->fetch(PDO::FETCH_ASSOC); if ($row === false) { $cursor->closeCursor(); - throw new DoesNotExistException('Did expect one result but found none when executing' . $qb); + throw new DoesNotExistException('Did expect one result but found none when executing query: ' . $qb->getSQL()); } $row2 = $cursor->fetch(); $cursor->closeCursor(); if ($row2 !== false) { - throw new MultipleObjectsReturnedException('Did not expect more than one result when executing' . $query); + throw new MultipleObjectsReturnedException('Did not expect more than one result when executing query: ' . $qb->getSQL()); } return $this->mapRowToEntity($row); @@ -89,7 +89,7 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper { $row = $cursor->fetch(PDO::FETCH_ASSOC); if ($row === false) { $cursor->closeCursor(); - throw new DoesNotExistException('Did expect one result but found none when executing' . $qb); + throw new DoesNotExistException('Did expect one result but found none when executing query: ' . $qb->getSQL()); } $cursor->closeCursor(); return $this->mapRowToEntity($row);