diff --git a/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache b/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache index c1adc2f64a4..f4d825ed365 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache @@ -135,6 +135,12 @@ class Controller if (null === $exception) { return null; } + + if (!$this->container->get('kernel')->isDebug()) { + return [ + 'message' => $exception->getMessage(), + ]; + } return [ 'message' => $exception->getMessage(),