From 4d5cec05216c7fee38b6d7947d36749dc9113024 Mon Sep 17 00:00:00 2001 From: Henk van de Berg <11218586+holkerveen@users.noreply.github.com> Date: Fri, 4 Jul 2025 20:18:00 +0200 Subject: [PATCH] Removed try/catch to enable framework error handling to pick up the error --- .../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 f033a07e361e..2fc988698207 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}}