Fixed database migration error handling

(Error page was not shown properly)
This commit is contained in:
Bernd Bestel
2020-12-20 16:52:13 +01:00
parent 6ec3743d12
commit b2f555400c

View File

@@ -25,9 +25,13 @@ class ExceptionController extends BaseApiController
public function __invoke(ServerRequestInterface $request, Throwable $exception, bool $displayErrorDetails, bool $logErrors, bool $logErrorDetails, ?LoggerInterface $logger = null)
{
$response = $this->app->getResponseFactory()->createResponse();
$isApiRoute = string_starts_with($request->getUri()->getPath(), '/api/');
if (!defined('GROCY_AUTHENTICATED'))
{
define('GROCY_AUTHENTICATED', false);
}
if ($isApiRoute)
{
$status = 500;