Skip to content
Snippets Groups Projects
Unverified Commit fe378200 authored by Daniel Kesselberg's avatar Daniel Kesselberg
Browse files

Check for generic errors at last.

parent 3a9c7f99
No related branches found
No related tags found
No related merge requests found
...@@ -75,19 +75,6 @@ class DbalException extends Exception { ...@@ -75,19 +75,6 @@ class DbalException extends Exception {
} }
public function getReason(): ?int { 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 * Constraint errors
*/ */
...@@ -131,6 +118,19 @@ class DbalException extends Exception { ...@@ -131,6 +118,19 @@ class DbalException extends Exception {
return parent::REASON_SERVER; 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; return null;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment