]> git.mxchange.org Git - friendica.git/commitdiff
Fix errors in Core namespace
authorArt4 <art4@wlabs.de>
Tue, 19 Nov 2024 07:40:46 +0000 (07:40 +0000)
committerArt4 <art4@wlabs.de>
Tue, 19 Nov 2024 07:40:46 +0000 (07:40 +0000)
src/Core/Lock/Type/DatabaseLock.php
src/Core/PConfig/Repository/PConfig.php

index 9a007910073c1126d8ecd3e9cb87730914f9a6e0..9699522807feb9c67f34ad6532ae2970f122b23d 100644 (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']);
index 39a5c318005453a9f84e75524c7489c7b95ec5a2..0b47fad67dec76f816230f9f4bb326a011950162 100644 (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);
                }