Error:
Fatal error: in D:\webroot\sri3\vendor\yiisoft\yii2\db\Schema.php on line 636
try {
$dbcom1 = \Yii::$app->db->createCommand( $sSqlC. $sSql );
$rs1 = $dbcom1->queryOne(); --> this line raise the Exception
...
...
} catch( Exception $e ) {
$sMsg = $e->getMessage() . $sSql;
$nErro = 1;
}
yiisoft\yii2\db\Schema.php
/**
* Converts a DB exception to a more concrete one if possible.
*
* @param \Exception $e
* @param string $rawSql SQL that produced exception
* @return Exception
*/
public function convertException(\Exception $e, $rawSql)
{
if ($e instanceof Exception) {
return $e;
}
$exceptionClass = '\yii\db\Exception';
foreach ($this->exceptionMap as $error => $class) {
if (strpos($e->getMessage(), $error) !== false) {
$exceptionClass = $class;
}
}
$message = $e->getMessage() . "\nThe SQL being executed was: $rawSql";
$errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;
return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e); -->Line 636
}
How to solve?