Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
11cded9b
Commit
11cded9b
authored
May 07, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Sphinx schema
parent
a17e5582
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
Schema.php
extensions/sphinx/Schema.php
+19
-6
No files found.
extensions/sphinx/Schema.php
View file @
11cded9b
...
...
@@ -11,6 +11,7 @@ use yii\base\Object;
use
yii\caching\Cache
;
use
Yii
;
use
yii\caching\GroupDependency
;
use
yii\db\Exception
;
/**
* Schema represents the Sphinx schema information.
...
...
@@ -60,12 +61,6 @@ class Schema extends Object
private
$_builder
;
/**
* @var array map of DB errors and corresponding exceptions
* If left part is found in DB error message exception class from the right part is used.
*/
public
$exceptionMap
=
[];
/**
* @var array mapping from physical column types (keys) to abstract column types (values)
*/
public
$typeMap
=
[
...
...
@@ -505,4 +500,22 @@ class Schema extends Object
return
$column
;
}
/**
* Handles database error
*
* @param \Exception $e
* @param string $rawSql SQL that produced exception
* @throws Exception
*/
public
function
handleException
(
\Exception
$e
,
$rawSql
)
{
if
(
$e
instanceof
Exception
)
{
throw
$e
;
}
else
{
$message
=
$e
->
getMessage
()
.
"
\n
The SQL being executed was:
$rawSql
"
;
$errorInfo
=
$e
instanceof
\PDOException
?
$e
->
errorInfo
:
null
;
throw
new
Exception
(
$message
,
$errorInfo
,
(
int
)
$e
->
getCode
(),
$e
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment