Fixed error reporting

This commit is contained in:
Eldad Fux
2021-01-17 15:50:01 +02:00
parent 5aff018d11
commit bf2c8b4010
+6 -3
View File
@@ -254,9 +254,12 @@ App::error(function ($error, $utopia, $request, $response, $layout, $project) {
$route = $utopia->match($request);
$template = ($route) ? $route->getLabel('error', null) : null;
if (php_sapi_name() === 'cli' && $route) {
Console::error('[Error] Method: '.$route->getMethod());
Console::error('[Error] URL: '.$route->getURL());
if (php_sapi_name() === 'cli') {
if($route) {
Console::error('[Error] Method: '.$route->getMethod());
Console::error('[Error] URL: '.$route->getURL());
}
Console::error('[Error] Type: '.get_class($error));
Console::error('[Error] Message: '.$error->getMessage());
Console::error('[Error] File: '.$error->getFile());