Check for generic errors at last.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2021-02-02 18:27:28 +01:00
parent 3a9c7f99f6
commit fe378200fa
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 13 additions and 13 deletions

View File

@ -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;
}
}