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