volodymyr-klymniuk/exception-handler-bundle

MIT-advertising


License
MIT-advertising

Documentation

Exception Handler Bundle

About

The Exception Handler Bundle helps to catch and process output for different types of exceptions

Installation

Require the bundle and its dependencies with composer:

$ composer require volodymyr-klymniuk/exception-handler-bundle

Register the bundle:

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        ...
        new ExceptionHandlerBundle\ExceptionHandlerBundle(),
    );
}

Handle form validation

    <?php
    $form = $this->formFactory->create($formType, $data);
    
    $form->submit($request->request->all());
    if (!$form->isValid()) {
        throw new FormValidationException($form);
    }