You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now our API exports the Doctrine/dbal exception. As we've seen
with the dbal 3 upgrade, the leakage of 3rdparty types is problematic as
a dependency update means lots of work in apps, due to the direct
dependency of what Nextcloud ships. This breaks this dependency so that
apps only need to depend on our public API. That API can then be vendor
(db lib) agnostic and we can work around future deprecations/removals in
dbal more easily.
Right now the type of exception thrown is transported as "reason". For
the more popular types of errors we can extend the new exception class
and allow apps to catch specific errors only. Right now they have to
catch-check-rethrow. This is not ideal, but better than the dependnecy
on dbal.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -67,6 +70,7 @@ public function fixupStatement($statement) {
67
70
* Create an exclusive read+write lock on a table
68
71
*
69
72
* @param string $tableName
73
+
* @throws Exception
70
74
* @since 9.1.0
71
75
*/
72
76
publicfunctionlockTable($tableName) {
@@ -77,6 +81,7 @@ public function lockTable($tableName) {
77
81
/**
78
82
* Release a previous acquired lock again
79
83
*
84
+
* @throws Exception
80
85
* @since 9.1.0
81
86
*/
82
87
publicfunctionunlockTable() {
@@ -94,7 +99,7 @@ public function unlockTable() {
94
99
* If this is null or an empty array, all keys of $input will be compared
95
100
* Please note: text fields (clob) must not be used in the compare array
96
101
* @return int number of inserted rows
97
-
* @throws \Doctrine\DBAL\Exception
102
+
* @throws Exception
98
103
* @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
0 commit comments