feat(admin): add more details for admin errors
This commit is contained in:
@@ -136,7 +136,10 @@ class ControllerExtensionModuleTgshop extends Controller
|
|||||||
http_response_code(HttpResponse::HTTP_INTERNAL_SERVER_ERROR);
|
http_response_code(HttpResponse::HTTP_INTERNAL_SERVER_ERROR);
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => getenv('APP_DEBUG') ? $e->getMessage() : 'Server Error.',
|
'error' => $e->getMessage(),
|
||||||
|
'code' => $e->getCode(),
|
||||||
|
'file' => $e->getFile(),
|
||||||
|
'line' => $e->getLine(),
|
||||||
], JSON_THROW_ON_ERROR);
|
], JSON_THROW_ON_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user