From faa3a0e4c1efecf0b331dcabe19c9a14d97e295e Mon Sep 17 00:00:00 2001 From: Henk van de Berg <11218586+holkerveen@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:15:05 +0200 Subject: [PATCH] Removed try/catch to enable framework error handling to pick up the error (#21523) --- .../main/resources/php-laravel/api_controller.mustache | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-laravel/api_controller.mustache b/modules/openapi-generator/src/main/resources/php-laravel/api_controller.mustache index 0ae5062474e..f927c45aa75 100644 --- a/modules/openapi-generator/src/main/resources/php-laravel/api_controller.mustache +++ b/modules/openapi-generator/src/main/resources/php-laravel/api_controller.mustache @@ -87,13 +87,8 @@ class {{controllerName}} extends Controller {{/isPathParam}} {{/allParams}} - try { - $apiResult = $this->api->{{operationId}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } catch (\Exception $exception) { - // This shouldn't happen - report($exception); - return response()->json(['error' => $exception->getMessage()], 500); - } + + $apiResult = $this->api->{{operationId}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#responses}} {{#isArray}}