mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
DbObject: provide friendler not-found errors
This commit is contained in:
parent
af71138227
commit
4af6b11f58
@ -560,12 +560,20 @@ abstract class DbObject
|
||||
$properties = $this->db->fetchRow($select);
|
||||
|
||||
if (empty($properties)) {
|
||||
|
||||
if (is_array($this->getKeyName())) {
|
||||
throw new NotFoundError(
|
||||
'Got no "%s" data for: %s (%s)',
|
||||
'Failed to load %s for %s',
|
||||
$this->table,
|
||||
$this->getLogId(),
|
||||
$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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user