mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-04 21:19:41 +00:00
show errors from relatorio driver
This commit is contained in:
@@ -18,6 +18,7 @@ use Chill\DocGeneratorBundle\Context\DocGeneratorContextWithPublicFormInterface;
|
||||
use Chill\DocGeneratorBundle\Context\Exception\ContextNotFoundException;
|
||||
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||
use Chill\DocGeneratorBundle\GeneratorDriver\DriverInterface;
|
||||
use Chill\DocGeneratorBundle\GeneratorDriver\Exception\TemplateException;
|
||||
use Chill\DocGeneratorBundle\Repository\DocGeneratorTemplateRepository;
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
@@ -276,7 +277,15 @@ final class DocGeneratorTemplateController extends AbstractController
|
||||
$datas = $context->getData($template, $entity, $contextGenerationData);
|
||||
dump('datas compiled', $datas);
|
||||
|
||||
$generatedResource = $this->driver->generateFromResource($templateResource, $template->getFile()->getType(), $datas, $template->getFile()->getFilename());
|
||||
try {
|
||||
$generatedResource = $this->driver->generateFromResource($templateResource, $template->getFile()->getType(), $datas, $template->getFile()->getFilename());
|
||||
} catch (TemplateException $e) {
|
||||
$msg = implode("\n", $e->getErrors());
|
||||
|
||||
return new Response($msg, 400, [
|
||||
'Content-Type' => 'text/plain',
|
||||
]);
|
||||
}
|
||||
|
||||
fclose($templateResource);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user