forward query exception when fallback construction fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
3401be216d
commit
ec875227ec
|
@ -97,7 +97,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
||||||
return $this->query($resolveName);
|
return $this->query($resolveName);
|
||||||
} catch (QueryException $e2) {
|
} catch (QueryException $e2) {
|
||||||
// don't lose the error we got while trying to query by type
|
// don't lose the error we got while trying to query by type
|
||||||
throw new QueryException($e2->getMessage(), $e2->getCode(), $e);
|
throw new QueryException($e2->getMessage(), (int) $e2->getCode(), $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,11 @@ class Application {
|
||||||
$c = \OC::$server->query($command);
|
$c = \OC::$server->query($command);
|
||||||
} catch (QueryException $e) {
|
} catch (QueryException $e) {
|
||||||
if (class_exists($command)) {
|
if (class_exists($command)) {
|
||||||
$c = new $command();
|
try {
|
||||||
|
$c = new $command();
|
||||||
|
} catch (\ArgumentCountError $e2) {
|
||||||
|
throw new \Exception("Failed to construct console command '$command': " . $e->getMessage(), 0, $e);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception("Console command '$command' is unknown and could not be loaded");
|
throw new \Exception("Console command '$command' is unknown and could not be loaded");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue