aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/DB/Exceptions/DbalException.php26
-rw-r--r--lib/private/Files/Template/TemplateManager.php3
2 files changed, 16 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;
}
}
diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php
index 491d66d53e9..44e1b10fa35 100644
--- a/lib/private/Files/Template/TemplateManager.php
+++ b/lib/private/Files/Template/TemplateManager.php
@@ -115,6 +115,9 @@ class TemplateManager implements ITemplateManager {
}
public function getTypes(): array {
+ if (!empty($this->types)) {
+ return $this->types;
+ }
foreach ($this->registeredTypes as $registeredType) {
$this->types[] = $registeredType();
}