Exceptions
Exceptions 3
Doctrine\DBAL\Exception\ ConnectionException
case '42P07':
return new TableExistsException($message, $exception);
case '08006':
return new Exception\ConnectionException($message, $exception);
case '7':
// Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.3.22 and PHP 7.4.10),
// in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code.
// The exception code would be always set to 7 here.
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php
->
convertException
(line 182)
if ($driverEx instanceof DriverException) {
return $driverEx;
}
if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DeprecatedDriverException) {
return $driver->convertException($msg, $driverEx);
}
return new Exception($msg, 0, $driverEx);
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php
::
wrapException
(line 169)
*
* @return Exception
*/
public static function driverException(Driver $driver, Throwable $driverEx)
{
return self::wrapException($driver, $driverEx, 'An exception occurred in driver: ' . $driverEx->getMessage());
}
/**
* @return Exception
*/
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
::
driverException
(line 52)
$pdo->exec('SET NAMES \'' . $params['charset'] . '\'');
}
return $pdo;
} catch (PDOException $e) {
throw Exception::driverException($this, $e);
}
}
/**
* Constructs the Postgres PDO DSN.
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 412)
$driverOptions = $this->params['driverOptions'] ?? [];
$user = $this->params['user'] ?? null;
$password = $this->params['password'] ?? null;
$this->_conn = $this->_driver->connect($this->params, $user, $password, $driverOptions);
$this->transactionNestingLevel = 0;
if ($this->autoCommit === false) {
$this->beginTransaction();
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 1952)
*
* @return DriverConnection
*/
public function getWrappedConnection()
{
$this->connect();
assert($this->_conn !== null);
return $this->_conn;
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
getWrappedConnection
(line 1290)
{
if ($qcp !== null) {
return $this->executeCacheQuery($sql, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($sql, $params, $types);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
->
executeQuery
(line 918)
{
$this->switchPersisterContext($offset, $limit);
$sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
$hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php
->
loadAll
(line 225)
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->loadAll($criteria, $orderBy, $limit, $offset);
}
/**
* Finds a single entity by a set of criteria.
*
}
public function getHeaderKategori()
{
$mKategoriRepo = $this->getDoctrine()->getRepository(MKategori::class);
$kategori = $mKategoriRepo->findBy([], ['id' => 'asc']);
return $kategori;
}
public function getDataTable($id, $limit, $page, $get, $state = null, $row = null)
// return $this->redirect($request->server->get('HTTP_REFERER'));
}
return $this->render('/frontend/t_feedback/form.html.twig', [
'form' => $form->createView(),
'header_kategori' => $this->getHeaderKategori(),
]);
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
form
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Doctrine\DBAL\Driver\PDO\ Exception
*/
final class Exception extends PDOException
{
public static function new(\PDOException $exception): self
{
return new self($exception);
}
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
::
new
(line 44)
try {
parent::__construct($dsn, (string) $user, (string) $password, (array) $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
}
/**
* {@inheritdoc}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
->
__construct
(line 27)
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
{
try {
$pdo = new PDO\Connection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 412)
$driverOptions = $this->params['driverOptions'] ?? [];
$user = $this->params['user'] ?? null;
$password = $this->params['password'] ?? null;
$this->_conn = $this->_driver->connect($this->params, $user, $password, $driverOptions);
$this->transactionNestingLevel = 0;
if ($this->autoCommit === false) {
$this->beginTransaction();
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 1952)
*
* @return DriverConnection
*/
public function getWrappedConnection()
{
$this->connect();
assert($this->_conn !== null);
return $this->_conn;
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
getWrappedConnection
(line 1290)
{
if ($qcp !== null) {
return $this->executeCacheQuery($sql, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($sql, $params, $types);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
->
executeQuery
(line 918)
{
$this->switchPersisterContext($offset, $limit);
$sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
$hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php
->
loadAll
(line 225)
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->loadAll($criteria, $orderBy, $limit, $offset);
}
/**
* Finds a single entity by a set of criteria.
*
}
public function getHeaderKategori()
{
$mKategoriRepo = $this->getDoctrine()->getRepository(MKategori::class);
$kategori = $mKategoriRepo->findBy([], ['id' => 'asc']);
return $kategori;
}
public function getDataTable($id, $limit, $page, $get, $state = null, $row = null)
// return $this->redirect($request->server->get('HTTP_REFERER'));
}
return $this->render('/frontend/t_feedback/form.html.twig', [
'form' => $form->createView(),
'header_kategori' => $this->getHeaderKategori(),
]);
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
form
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
PDOException
* @throws PDOException In case of an error.
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
{
try {
parent::__construct($dsn, (string) $user, (string) $password, (array) $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
->
__construct
(line 40)
* @throws PDOException In case of an error.
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
{
try {
parent::__construct($dsn, (string) $user, (string) $password, (array) $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
->
__construct
(line 27)
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
{
try {
$pdo = new PDO\Connection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 412)
$driverOptions = $this->params['driverOptions'] ?? [];
$user = $this->params['user'] ?? null;
$password = $this->params['password'] ?? null;
$this->_conn = $this->_driver->connect($this->params, $user, $password, $driverOptions);
$this->transactionNestingLevel = 0;
if ($this->autoCommit === false) {
$this->beginTransaction();
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
connect
(line 1952)
*
* @return DriverConnection
*/
public function getWrappedConnection()
{
$this->connect();
assert($this->_conn !== null);
return $this->_conn;
}
in
vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
->
getWrappedConnection
(line 1290)
{
if ($qcp !== null) {
return $this->executeCacheQuery($sql, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($sql, $params, $types);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php
->
executeQuery
(line 918)
{
$this->switchPersisterContext($offset, $limit);
$sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
$hydrator = $this->em->newHydrator($this->currentPersisterContext->selectJoinSql ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT);
return $hydrator->hydrateAll($stmt, $this->currentPersisterContext->rsm, [UnitOfWork::HINT_DEFEREAGERLOAD => true]);
}
in
vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php
->
loadAll
(line 225)
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->loadAll($criteria, $orderBy, $limit, $offset);
}
/**
* Finds a single entity by a set of criteria.
*
}
public function getHeaderKategori()
{
$mKategoriRepo = $this->getDoctrine()->getRepository(MKategori::class);
$kategori = $mKategoriRepo->findBy([], ['id' => 'asc']);
return $kategori;
}
public function getDataTable($id, $limit, $page, $get, $state = null, $row = null)
// return $this->redirect($request->server->get('HTTP_REFERER'));
}
return $this->render('/frontend/t_feedback/form.html.twig', [
'form' => $form->createView(),
'header_kategori' => $this->getHeaderKategori(),
]);
}
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
form
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Stack Traces 3
[3/3]
ConnectionException
|
---|
Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections? at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php:88 at Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException() (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182) at Doctrine\DBAL\DBALException::wrapException() (vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:169) at Doctrine\DBAL\DBALException::driverException() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:52) at Doctrine\DBAL\Driver\PDOPgSql\Driver->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:412) at Doctrine\DBAL\Connection->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1952) at Doctrine\DBAL\Connection->getWrappedConnection() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1290) at Doctrine\DBAL\Connection->executeQuery() (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:918) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll() (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:225) at Doctrine\ORM\EntityRepository->findBy() (src/Controller/Base/BaseController.php:271) at App\Controller\Base\BaseController->getHeaderKategori() (src/Controller/Frontend/TFeedbackController.php:60) at App\Controller\Frontend\TFeedbackController->form() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:20) |
[2/3]
Exception
|
---|
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections? at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18 at Doctrine\DBAL\Driver\PDO\Exception::new() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:44) at Doctrine\DBAL\Driver\PDOConnection->__construct() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:27) at Doctrine\DBAL\Driver\PDOPgSql\Driver->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:412) at Doctrine\DBAL\Connection->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1952) at Doctrine\DBAL\Connection->getWrappedConnection() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1290) at Doctrine\DBAL\Connection->executeQuery() (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:918) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll() (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:225) at Doctrine\ORM\EntityRepository->findBy() (src/Controller/Base/BaseController.php:271) at App\Controller\Base\BaseController->getHeaderKategori() (src/Controller/Frontend/TFeedbackController.php:60) at App\Controller\Frontend\TFeedbackController->form() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:20) |
[1/3]
PDOException
|
---|
PDOException: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections? at vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40 at PDO->__construct() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40) at Doctrine\DBAL\Driver\PDOConnection->__construct() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php:27) at Doctrine\DBAL\Driver\PDOPgSql\Driver->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:412) at Doctrine\DBAL\Connection->connect() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1952) at Doctrine\DBAL\Connection->getWrappedConnection() (vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1290) at Doctrine\DBAL\Connection->executeQuery() (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:918) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll() (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:225) at Doctrine\ORM\EntityRepository->findBy() (src/Controller/Base/BaseController.php:271) at App\Controller\Base\BaseController->getHeaderKategori() (src/Controller/Frontend/TFeedbackController.php:60) at App\Controller\Frontend\TFeedbackController->form() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:20) |