Logos, robots and some fixs
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Entity\Document;
|
||||
use App\Entity\Directory;
|
||||
use App\Form\CommentType;
|
||||
use App\Form\SearchBarType;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use App\Repository\DocumentRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
@@ -24,9 +25,11 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
class DocumentController extends AbstractController
|
||||
{
|
||||
private TokenStorageInterface $TokenStorage;
|
||||
private LoggerInterface $logger;
|
||||
|
||||
public function __construct(TokenStorageInterface $TokenStorage)
|
||||
public function __construct(TokenStorageInterface $TokenStorage, LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
$this->TokenStorage = $TokenStorage;
|
||||
}
|
||||
|
||||
@@ -163,6 +166,8 @@ class DocumentController extends AbstractController
|
||||
} catch (\Throwable $th) {
|
||||
if ($_ENV['APP_ENV'] === 'dev') {
|
||||
throw $th; //DEBUG
|
||||
} else {
|
||||
$this->logger->error($th);
|
||||
}
|
||||
|
||||
$this->addFlash('danger', 'alert_error_creating_document');
|
||||
@@ -238,6 +243,8 @@ class DocumentController extends AbstractController
|
||||
} catch (\Throwable $th) {
|
||||
if ($_ENV['APP_ENV'] === 'dev') {
|
||||
throw $th; //DEBUG
|
||||
} else {
|
||||
$this->logger->error($th);
|
||||
}
|
||||
|
||||
$this->addFlash('danger', 'alert_error_editing_document');
|
||||
|
||||
Reference in New Issue
Block a user