summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2021-02-02 18:27:28 +0100
committerDaniel Kesselberg <mail@danielkesselberg.de>2021-02-02 18:28:49 +0100
commitfe378200fa7105512dc2ca487af63f7b57813588 (patch)
tree6dda842685fa93df041d7959d0d250dfc346a142 /lib/private/DB
parent3a9c7f99f632f973caaf6a7aca5ca9294bb11db3 (diff)
downloadnextcloud-server-fe378200fa7105512dc2ca487af63f7b57813588.tar.gz
nextcloud-server-fe378200fa7105512dc2ca487af63f7b57813588.zip
Check for generic errors at last.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/Exceptions/DbalException.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/private/DB/Exceptions/DbalException.php b/lib/private/DB/Exceptions/DbalException.php
index 4e0e1517048..bdb4d3147ae 100644
--- a/lib/private/DB/Exceptions/DbalException.php
+++ b/lib/private/DB/Exceptions/DbalException.php
@@ -76,19 +76,6 @@ class DbalException extends Exception {
public function getReason(): ?int {
/**
- * Generic errors
- */
- if ($this->original instanceof ConnectionException) {
- return parent::REASON_CONNECTION_LOST;
- }
- if ($this->original instanceof DriverException) {
- return parent::REASON_DRIVER;
- }
- if ($this->original instanceof InvalidArgumentException) {
- return parent::REASON_INVALID_ARGUMENT;
- }
-
- /**
* Constraint errors
*/
if ($this->original instanceof ForeignKeyConstraintViolationException) {
@@ -131,6 +118,19 @@ class DbalException extends Exception {
return parent::REASON_SERVER;
}
+ /**
+ * Generic errors
+ */
+ if ($this->original instanceof ConnectionException) {
+ return parent::REASON_CONNECTION_LOST;
+ }
+ if ($this->original instanceof InvalidArgumentException) {
+ return parent::REASON_INVALID_ARGUMENT;
+ }
+ if ($this->original instanceof DriverException) {
+ return parent::REASON_DRIVER;
+ }
+
return null;
}
}