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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
767a78f8
Commit
767a78f8
authored
Apr 19, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better handling of errors during rendering an error
parent
2a12fdbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
Application.php
framework/base/Application.php
+1
-1
ErrorHandler.php
framework/base/ErrorHandler.php
+15
-12
No files found.
framework/base/Application.php
View file @
767a78f8
...
...
@@ -411,7 +411,7 @@ class Application extends Module
error_log
(
$exception
);
if
((
$handler
=
$this
->
getErrorHandler
())
!==
null
)
{
@
$handler
->
handle
(
$exception
);
$handler
->
handle
(
$exception
);
}
else
{
$this
->
renderException
(
$exception
);
}
...
...
framework/base/ErrorHandler.php
View file @
767a78f8
...
...
@@ -81,19 +81,22 @@ class ErrorHandler extends Component
if
(
isset
(
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
])
&&
$_SERVER
[
'HTTP_X_REQUESTED_WITH'
]
===
'XMLHttpRequest'
)
{
\Yii
::
$app
->
renderException
(
$exception
);
}
else
{
try
{
$view
=
new
View
;
if
(
!
YII_DEBUG
||
$exception
instanceof
UserException
)
{
$viewName
=
$this
->
errorView
;
}
else
{
$viewName
=
$this
->
exceptionView
;
}
echo
$view
->
renderFile
(
$viewName
,
array
(
'exception'
=>
$exception
,
),
$this
);
if
(
YII_DEBUG
)
{
ini_set
(
'display_errors'
,
1
);
}
catch
(
\Exception
$e
)
{
\Yii
::
$app
->
renderException
(
$e
);
$view
=
new
View
;
if
(
!
YII_DEBUG
||
$exception
instanceof
UserException
)
{
$viewName
=
$this
->
errorView
;
}
else
{
$viewName
=
$this
->
exceptionView
;
}
echo
$view
->
renderFile
(
$viewName
,
array
(
'exception'
=>
$exception
,
),
$this
);
if
(
YII_DEBUG
)
{
ini_set
(
'display_errors'
,
0
);
}
}
}
else
{
...
...
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