mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
Merge pull request #29979 from nextcloud/backport/29974/stable21
[stable21] Let repair step query exceptions bubble up
This commit is contained in:
commit
086e79eecd
1 changed files with 9 additions and 2 deletions
|
|
@ -79,6 +79,7 @@ use OCP\Migration\IOutput;
|
|||
use OCP\Migration\IRepairStep;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
use Throwable;
|
||||
|
||||
class Repair implements IOutput {
|
||||
|
||||
|
|
@ -131,9 +132,15 @@ class Repair implements IOutput {
|
|||
$s = \OC::$server->query($repairStep);
|
||||
} catch (QueryException $e) {
|
||||
if (class_exists($repairStep)) {
|
||||
$s = new $repairStep();
|
||||
try {
|
||||
// Last resort: hope there are no constructor arguments
|
||||
$s = new $repairStep();
|
||||
} catch (Throwable $inner) {
|
||||
// Well, it was worth a try
|
||||
throw new \Exception("Repair step '$repairStep' can't be instantiated: " . $e->getMessage(), 0, $e);
|
||||
}
|
||||
} else {
|
||||
throw new \Exception("Repair step '$repairStep' is unknown");
|
||||
throw new \Exception("Repair step '$repairStep' is unknown", 0, $e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue