Removed try/catch to enable framework error handling to pick up the error (#21523)

This commit is contained in:
Henk van de Berg
2025-08-01 10:15:05 +02:00
committed by GitHub
parent 97aa4a8587
commit faa3a0e4c1

View File

@@ -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}}