Handle qb mapper exception messages properly
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot-nextcloud[bot]
parent
ad4174f6bd
commit
5214377341
@@ -67,13 +67,13 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
|||||||
$row = $cursor->fetch(PDO::FETCH_ASSOC);
|
$row = $cursor->fetch(PDO::FETCH_ASSOC);
|
||||||
if ($row === false) {
|
if ($row === false) {
|
||||||
$cursor->closeCursor();
|
$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();
|
$row2 = $cursor->fetch();
|
||||||
$cursor->closeCursor();
|
$cursor->closeCursor();
|
||||||
if ($row2 !== false) {
|
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);
|
return $this->mapRowToEntity($row);
|
||||||
@@ -89,7 +89,7 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
|||||||
$row = $cursor->fetch(PDO::FETCH_ASSOC);
|
$row = $cursor->fetch(PDO::FETCH_ASSOC);
|
||||||
if ($row === false) {
|
if ($row === false) {
|
||||||
$cursor->closeCursor();
|
$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();
|
$cursor->closeCursor();
|
||||||
return $this->mapRowToEntity($row);
|
return $this->mapRowToEntity($row);
|
||||||
|
|||||||
Reference in New Issue
Block a user