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
0cfd41a2
Commit
0cfd41a2
authored
Jan 31, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let application exit with code 1 on error/exception in console
fixes #2233
parent
9ba8b185
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Application.php
framework/base/Application.php
+3
-0
ErrorHandler.php
framework/base/ErrorHandler.php
+1
-1
No files found.
framework/base/Application.php
View file @
0cfd41a2
...
@@ -515,6 +515,9 @@ abstract class Application extends Module
...
@@ -515,6 +515,9 @@ abstract class Application extends Module
$handler
->
handle
(
$exception
);
$handler
->
handle
(
$exception
);
}
else
{
}
else
{
echo
$this
->
renderException
(
$exception
);
echo
$this
->
renderException
(
$exception
);
if
(
PHP_SAPI
===
'cli'
)
{
exit
(
1
);
}
}
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
// exception could be thrown in ErrorHandler::handle()
// exception could be thrown in ErrorHandler::handle()
...
...
framework/base/ErrorHandler.php
View file @
0cfd41a2
...
@@ -87,7 +87,7 @@ class ErrorHandler extends Component
...
@@ -87,7 +87,7 @@ class ErrorHandler extends Component
{
{
if
(
Yii
::
$app
instanceof
\yii\console\Application
||
YII_ENV_TEST
)
{
if
(
Yii
::
$app
instanceof
\yii\console\Application
||
YII_ENV_TEST
)
{
echo
Yii
::
$app
->
renderException
(
$exception
);
echo
Yii
::
$app
->
renderException
(
$exception
);
return
;
exit
(
1
)
;
}
}
$useErrorView
=
!
YII_DEBUG
||
$exception
instanceof
UserException
;
$useErrorView
=
!
YII_DEBUG
||
$exception
instanceof
UserException
;
...
...
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