Catch pipeline's own exception

This commit is contained in:
Franz Liedke 2018-11-13 22:27:11 +01:00
parent 9a415670a3
commit b678367498

View File

@ -11,9 +11,9 @@
namespace Flarum\Install\Controller; namespace Flarum\Install\Controller;
use Exception;
use Flarum\Http\SessionAuthenticator; use Flarum\Http\SessionAuthenticator;
use Flarum\Install\Installation; use Flarum\Install\Installation;
use Flarum\Install\StepFailed;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Server\RequestHandlerInterface; use Psr\Http\Server\RequestHandlerInterface;
@ -102,8 +102,8 @@ class InstallController implements RequestHandlerInterface
try { try {
$pipeline->run(); $pipeline->run();
} catch (Exception $e) { } catch (StepFailed $e) {
return new Response\HtmlResponse($e->getMessage(), 500); return new Response\HtmlResponse($e->getPrevious()->getMessage(), 500);
} }
$session = $request->getAttribute('session'); $session = $request->getAttribute('session');