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
fa661221
Commit
fa661221
authored
Mar 07, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2651 from yiisoft/error-handler-adjustments
Fixes #2603: `yii\base\ErrorHandler` now extends `\ErrorHandler`
parents
c5ec3550
44558df5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
13 deletions
+30
-13
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
ErrorException.php
framework/base/ErrorException.php
+29
-13
No files found.
framework/CHANGELOG.md
View file @
fa661221
...
...
@@ -186,6 +186,7 @@ Yii Framework 2 Change Log
-
Chg #2405: The CSS class of
`MaskedInput`
now defaults to
`form-control`
(qiangxue)
-
Chg #2426: Changed URL creation method signatures to be consistent (samdark)
-
Chg #2544: Changed
`DetailView`
's
`name:format:label`
to
`attribute:format:label`
to match
`GridView`
(samdark)
-
Chg #2603:
`yii\base\ErrorHandler`
now extends
`\ErrorHandler`
(samdark)
-
Chg: Renamed
`yii\jui\Widget::clientEventsMap`
to
`clientEventMap`
(qiangxue)
-
Chg: Renamed
`ActiveRecord::getPopulatedRelations()`
to
`getRelatedRecords()`
(qiangxue)
-
Chg: Renamed
`attributeName`
and
`className`
to
`targetAttribute`
and
`targetClass`
for
`UniqueValidator`
and
`ExistValidator`
(qiangxue)
...
...
framework/base/ErrorException.php
View file @
fa661221
...
...
@@ -15,10 +15,8 @@ use Yii;
* @author Alexander Makarov <sam@rmcreative.ru>
* @since 2.0
*/
class
ErrorException
extends
Exception
class
ErrorException
extends
\Error
Exception
{
protected
$severity
;
/**
* Constructs the exception.
* @link http://php.net/manual/en/errorexception.construct.php
...
...
@@ -74,16 +72,6 @@ class ErrorException extends Exception
}
/**
* Gets the exception severity.
* @link http://php.net/manual/en/errorexception.getseverity.php
* @return int the severity level of the exception.
*/
final
public
function
getSeverity
()
{
return
$this
->
severity
;
}
/**
* @return string the user-friendly name of this exception
*/
public
function
getName
()
...
...
@@ -105,4 +93,32 @@ class ErrorException extends Exception
];
return
isset
(
$names
[
$this
->
getCode
()])
?
$names
[
$this
->
getCode
()]
:
'Error'
;
}
/**
* Returns the array representation of this object.
* @return array the array representation of this object.
*/
public
function
toArray
()
{
return
$this
->
toArrayRecursive
(
$this
);
}
/**
* Returns the array representation of the exception and all previous exceptions recursively.
* @param \Exception $exception object
* @return array the array representation of the exception.
*/
protected
function
toArrayRecursive
(
$exception
)
{
$array
=
[
'type'
=>
get_class
(
$exception
),
'name'
=>
$exception
instanceof
self
?
$exception
->
getName
()
:
'Exception'
,
'message'
=>
$exception
->
getMessage
(),
'code'
=>
$exception
->
getCode
(),
];
if
((
$prev
=
$exception
->
getPrevious
())
!==
null
)
{
$array
[
'previous'
]
=
$this
->
toArrayRecursive
(
$prev
);
}
return
$array
;
}
}
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