summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-09-14 00:32:13 +0200
committerGitHub <noreply@github.com>2017-09-14 00:32:13 +0200
commit883574974d790008a68b408ef9d71ea0c033ef31 (patch)
treee02abe6706c9ed028bb30e0c95bd8c0b38157bca /lib/private
parentba2e1c5db909b24f6d0d8f0994cdc982c601fd8d (diff)
parentc4b3198ac23a61717ed1d1ceff639958030a7a42 (diff)
downloadnextcloud-server-883574974d790008a68b408ef9d71ea0c033ef31.tar.gz
nextcloud-server-883574974d790008a68b408ef9d71ea0c033ef31.zip
Merge pull request #6458 from nextcloud/rethrow-correct-exception
Rethrow the correct exception when there was an error in an app conta…
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 78400d8082e..e33ffdca96c 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -412,8 +412,15 @@ class DIContainer extends SimpleContainer implements IAppContainer {
public function query($name) {
try {
return $this->queryNoFallback($name);
- } catch (QueryException $e) {
- return $this->getServer()->query($name);
+ } catch (QueryException $firstException) {
+ try {
+ return $this->getServer()->query($name);
+ } catch (QueryException $secondException) {
+ if ($firstException->getCode() === 1) {
+ throw $secondException;
+ }
+ throw $firstException;
+ }
}
}
@@ -438,6 +445,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
}
throw new QueryException('Could not resolve ' . $name . '!' .
- ' Class can not be instantiated');
+ ' Class can not be instantiated', 1);
}
}