diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-02-02 18:59:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 18:59:43 +0100 |
commit | ad2033ef1d3df0ebc84f73de91ba3ad45d3fbc41 (patch) | |
tree | 4872f466f791c82664da62cfdc138179d822bc7e /lib | |
parent | 392dc8b8fa615b2aa9f54744e6c7f329e70a202f (diff) | |
parent | fe378200fa7105512dc2ca487af63f7b57813588 (diff) | |
download | nextcloud-server-ad2033ef1d3df0ebc84f73de91ba3ad45d3fbc41.tar.gz nextcloud-server-ad2033ef1d3df0ebc84f73de91ba3ad45d3fbc41.zip |
Merge pull request #25444 from nextcloud/bug/25415/move-generic-errors-to-end
Check for generic errors at last.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/Exceptions/DbalException.php | 26 |
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; } } |