diff options
author | Joas Schilling <coding@schilljs.com> | 2017-09-12 11:54:13 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-09-12 11:54:13 +0200 |
commit | c4b3198ac23a61717ed1d1ceff639958030a7a42 (patch) | |
tree | 8d0fc5567ee3cde0cd5287cb3d737813ca7eb181 /lib | |
parent | f5617d78ebda88550fb2c0e17c58bbdffdf177ee (diff) | |
download | nextcloud-server-c4b3198ac23a61717ed1d1ceff639958030a7a42.tar.gz nextcloud-server-c4b3198ac23a61717ed1d1ceff639958030a7a42.zip |
Rethrow the correct exception when there was an error in an app container
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 13 |
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); } } |