diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index 014fa535..453146c8 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -560,12 +560,20 @@ abstract class DbObject $properties = $this->db->fetchRow($select); if (empty($properties)) { - throw new NotFoundError( - 'Got no "%s" data for: %s (%s)', - $this->table, - $this->getLogId(), - $this->createWhere() - ); + + if (is_array($this->getKeyName())) { + throw new NotFoundError( + 'Failed to load %s for %s', + $this->table, + $this->createWhere() + ); + } else { + throw new NotFoundError( + 'Failed to load %s "%s"', + $this->table, + $this->getLogId() + ); + } } return $this->setDbProperties($properties); @@ -743,7 +751,6 @@ abstract class DbObject return $result; } - /** * Delete item from DB *