Fix admin error handling

This commit is contained in:
Toby Zerner 2017-11-29 16:10:22 +10:30
parent ba769e0c7e
commit 8edc8223e5

View File

@ -29,11 +29,8 @@ class Server extends AbstractServer
if ($app->isInstalled()) { if ($app->isInstalled()) {
$path = parse_url($app->url('admin'), PHP_URL_PATH); $path = parse_url($app->url('admin'), PHP_URL_PATH);
$errorDir = __DIR__.'/../../error';
// All requests should first be piped through our global error handler $pipe->pipe($path, $app->make('Flarum\Http\Middleware\HandleErrors', ['debug' => $app->inDebugMode() || ! $app->isUpToDate()]));
$debugMode = ! $app->isUpToDate() || $app->inDebugMode();
$pipe->pipe($path, new HandleErrors($errorDir, $app->make('log'), $debugMode));
if ($app->isUpToDate()) { if ($app->isUpToDate()) {
$pipe->pipe($path, $app->make('Flarum\Http\Middleware\ParseJsonBody')); $pipe->pipe($path, $app->make('Flarum\Http\Middleware\ParseJsonBody'));