mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #25444 from nextcloud/bug/25415/move-generic-errors-to-end
Check for generic errors at last.
This commit is contained in:
commit
ad2033ef1d
1 changed files with 13 additions and 13 deletions
|
|
@ -75,19 +75,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
|
||||
*/
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue