Add try/catch to find hr invalid bytecode escaping

This commit is contained in:
Dennis Eichhorn 2019-10-19 13:12:12 +02:00
parent e8ecfce4fd
commit 23fe8d2124

View File

@ -21,6 +21,7 @@ use phpOMS\DataStorage\Database\Query\QueryType;
use phpOMS\DataStorage\DataMapperInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Utils\ArrayUtils;
use Throwable;
/**
* Datamapper for databases.
@ -485,7 +486,14 @@ class DataMapperAbstract implements DataMapperInterface
$query->insert(static::$primaryField)->value(0);
}
try {
self::$db->con->prepare($query->toSql())->execute();
} catch (Throwable $t) {
// @todo: remove after debugging
// @fix: really remove it
// @critical: after we found the bug we MUST remove it!
var_dump($query->toSql());
}
return self::$db->con->lastInsertId();
}