Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let repair step query exceptions bubble up #29974

Merged
merged 2 commits into from
Nov 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/private/Repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Throwable;

class Repair implements IOutput {

Expand Down Expand Up @@ -140,7 +141,13 @@ public function addStep($repairStep) {
$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");
come-nc marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down