public static driverExceptionDuringQuery ( Doctrine\DBAL\Driver $driver, Exception $driverEx, string $sql, array $params = [] ) : |
||
$driver | Doctrine\DBAL\Driver | |
$driverEx | Exception | |
$sql | string | |
$params | array | |
리턴 |
public static function driverExceptionDuringQuery(Driver $driver, \Exception $driverEx, $sql, array $params = array())
{
$msg = "An exception occurred while executing '" . $sql . "'";
if ($params) {
$msg .= " with params " . self::formatParameters($params);
}
$msg .= ":\n\n" . $driverEx->getMessage();
return static::wrapException($driver, $driverEx, $msg);
}
/** * @return array */ public function validateDataProvider() { return [[$this->getDataSourceInterfaceMock(), false, DBALException::driverExceptionDuringQuery(new \Exception('failed'), 'sql')], [$this->getDataSourceInterfaceMock(), false, new InvalidConfigurationException()], [$this->getDataSourceInterfaceMock(), false, null], [$this->getOrmDataSourceInterfaceMock(), true, DBALException::driverExceptionDuringQuery(new \Exception('failed'), 'sql')], [$this->getOrmDataSourceInterfaceMock(), true, new InvalidConfigurationException()], [$this->getOrmDataSourceInterfaceMock(), true, null]]; }