From 64f06300f98c5963281a4ea0d116ea6e3859e6cf Mon Sep 17 00:00:00 2001 From: cydrickn Date: Sun, 29 Oct 2017 09:15:44 +0800 Subject: [PATCH 1/2] Update Controller.mustache --- .../src/main/resources/php-symfony/Controller.mustache | 6 ++++++ 1 file changed, 6 insertions(+) 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..086b8d1ac0d 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')->getEnvironment() === 'prod') { + return [ + 'message' => $exception->getMessage(), + ]; + } return [ 'message' => $exception->getMessage(), From 60a2c7aebf188434ff4713cb4bdce593a1870b8b Mon Sep 17 00:00:00 2001 From: cydrickn Date: Wed, 8 Nov 2017 07:56:06 +0800 Subject: [PATCH 2/2] Use debug instead of environment --- .../src/main/resources/php-symfony/Controller.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 086b8d1ac0d..f4d825ed365 100644 --- a/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache +++ b/modules/swagger-codegen/src/main/resources/php-symfony/Controller.mustache @@ -136,7 +136,7 @@ class Controller return null; } - if ($this->container->get('kernel')->getEnvironment() === 'prod') { + if (!$this->container->get('kernel')->isDebug()) { return [ 'message' => $exception->getMessage(), ];