Closed engharb closed 4 years ago
Hi,
I am running the FOS_rest bundle in symfony4 and I configured the fos_rest.yml file with the exception handler.
In DEV/test stage the exception is handled correctly, but in the production environment I used to get i.e
ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException
Is there something missing in the Symfony configuration or in the fos_rest.yml file?
# fos_rest.yml fos_rest: body_converter: enabled: true validate: true validation_errors_argument: validationErrors # This is the default value param_fetcher_listener: force view: mime_types: json: ['application/json', 'application/json;version=1.0', 'application/json;version=1.1'] view_response_listener: true formats: xml: false json: true templating_formats: html: false serialize_null: false routing_loader: default_format: json format_listener: rules: - { path: ^/, prefer_extension: true, fallback_format: json, priorities: [ json ] } exception: enabled: true exception_controller: 'App\Controller\BundleRestExceptionController::showAction' #exception_controller: 'fos_rest.exception.controller::showAction' allowed_methods_listener: true access_denied_listener: json: true body_listener: false serializer: version: null groups: [] serialize_null: false zone: - { path: ^/* }
OS: Linux PHP -v: 7.4
Closing as the exception_controller is deprecated in 2.8. You need to upgrade to symfony error renderer. See also fos_rest.exception.serializer_error_renderer config
fos_rest.exception.serializer_error_renderer
Hi,
I am running the FOS_rest bundle in symfony4 and I configured the fos_rest.yml file with the exception handler.
In DEV/test stage the exception is handled correctly, but in the production environment I used to get i.e
Is there something missing in the Symfony configuration or in the fos_rest.yml file?
OS: Linux PHP -v: 7.4