src/DependencyInjection/SonataPageExtension.php
public function configureExceptions(ContainerBuilder $container, array $config)
    {
        $exceptions = [];
        foreach ($config['catch_exceptions'] as $keyWord => $codes) {
            foreach ($codes as $code) {
                $exceptions[$code] = sprintf('_page_internal_error_%s', $keyWord);
            }
        }

        // add exception pages in exception_listener
        $container->getDefinition('sonata.page.kernel.exception_listener')
            ->replaceArgument(6, $exceptions);

        // add exception pages as default rendering parameters in page templates
        $container->getDefinition('sonata.page.template_manager')
            ->replaceArgument(1, ['error_codes' => $exceptions]);
    }
public function configureExceptions(ContainerBuilder $container, array $config)
    {
        $exceptions = [];
        foreach ($config['catch_exceptions'] as $keyWord => $codes) {
            foreach ($codes as $code) {
                $exceptions[$code] = sprintf('_page_internal_error_%s', $keyWord);
            }
        }

        // add exception pages in exception_listener
        $container->getDefinition('sonata.page.kernel.exception_listener')
            ->replaceArgument(6, $exceptions);

        // add exception pages as default rendering parameters in page templates
        $container->getDefinition('sonata.page.template_manager')
            ->replaceArgument(1, ['error_codes' => $exceptions]);
    }
public function configureExceptions ( ContainerBuilder $ container , array $ config ) { $ exceptions = [ ] ; foreach ( $ config [ 'catch_exceptions' ] as $ keyWord => $ codes ) { foreach ( $ codes as $ code ) { $ exceptions [ $ code ] = sprintf ( '_page_internal_error_%s' , $ keyWord ) ; } } // add exception pages in exception_listener $ container -> getDefinition ( 'sonata.page.kernel.exception_listener' ) -> replaceArgument ( 6 , $ exceptions ) ; // add exception pages as default rendering parameters in page templates $ container -> getDefinition ( 'sonata.page.template_manager' ) -> replaceArgument ( 1 , [ 'error_codes' => $ exceptions ] ) ; }
Configures the page custom exceptions.

@param ContainerBuilder $container Container builder
@param array            $config    An array of bundle configuration
Configures the page custom exceptions .