Fix errors in Core namespace

This commit is contained in:
Art4 2024-11-19 07:40:46 +00:00
parent 2b81529844
commit c1c158ccda
2 changed files with 9 additions and 1 deletions

View file

@ -182,7 +182,11 @@ class DatabaseLock extends AbstractLock
}
$stmt = $this->dba->select('locks', ['name'], $where);
} catch (\Exception $exception) {
throw new LockPersistenceException(sprintf('Cannot get lock with prefix %s', $prefix), $exception);
}
try {
$keys = [];
while ($key = $this->dba->fetch($stmt)) {
array_push($keys, $key['name']);

View file

@ -60,7 +60,11 @@ class PConfig
} else {
$configs = $this->db->select(static::$table_name, ['cat', 'v', 'k'], ['cat' => $cat, 'uid' => $uid]);
}
} catch (\Exception $exception) {
throw new PConfigPersistenceException(sprintf('Cannot load config category "%s" for user %d', $cat, $uid), $exception);
}
try {
while ($config = $this->db->fetch($configs)) {
$key = $config['k'];
$value = ValueConversion::toConfigValue($config['v']);
@ -71,7 +75,7 @@ class PConfig
}
}
} catch (\Exception $exception) {
throw new PConfigPersistenceException(sprintf('Cannot load config category %s for user %d', $cat, $uid), $exception);
throw new PConfigPersistenceException(sprintf('Cannot load config category "%s" for user %d', $cat, $uid), $exception);
} finally {
$this->db->close($configs);
}