Skip to content

Commit faa3a0e

Browse files
authored
Removed try/catch to enable framework error handling to pick up the error (#21523)
1 parent 97aa4a8 commit faa3a0e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

modules/openapi-generator/src/main/resources/php-laravel/api_controller.mustache

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ class {{controllerName}} extends Controller
8787
{{/isPathParam}}
8888

8989
{{/allParams}}
90-
try {
91-
$apiResult = $this->api->{{operationId}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
92-
} catch (\Exception $exception) {
93-
// This shouldn't happen
94-
report($exception);
95-
return response()->json(['error' => $exception->getMessage()], 500);
96-
}
90+
91+
$apiResult = $this->api->{{operationId}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
9792

9893
{{#responses}}
9994
{{#isArray}}

0 commit comments

Comments
 (0)