Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
bad9cf84
Commit
bad9cf84
authored
Apr 10, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'igorw/httpexception'
* igorw/httpexception: rename BaseHttpException to HttpException
parents
8aead8f9
2b020478
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
doc/usage.rst
doc/usage.rst
+2
-2
src/Silex/Extension/MonologExtension.php
src/Silex/Extension/MonologExtension.php
+2
-2
No files found.
doc/usage.rst
View file @
bad9cf84
...
...
@@ -310,7 +310,7 @@ You can also check for specific errors by using ``instanceof``, and handle
them differently::
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\
Base
HttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
$app->error(function(\Exception $e) {
...
...
@@ -318,7 +318,7 @@ them differently::
return new Response('The requested page could not be found.', 404);
}
$code = ($e instanceof
Base
HttpException) ? $e->getStatusCode() : 500;
$code = ($e instanceof HttpException) ? $e->getStatusCode() : 500;
return new Response('We are sorry, but something went terribly wrong.', $code);
});
...
...
src/Silex/Extension/MonologExtension.php
View file @
bad9cf84
...
...
@@ -17,7 +17,7 @@ use Monolog\Handler\StreamHandler;
use
Silex\Application
;
use
Silex\ExtensionInterface
;
use
Symfony\Component\HttpKernel\Exception\
Base
HttpException
;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
class
MonologExtension
implements
ExtensionInterface
{
...
...
@@ -54,7 +54,7 @@ class MonologExtension implements ExtensionInterface
});
$app
->
error
(
function
(
\Exception
$e
)
use
(
$app
)
{
if
(
$e
instanceof
Base
HttpException
)
{
if
(
$e
instanceof
HttpException
)
{
$app
[
'monolog'
]
->
addWarning
(
$e
->
getStatusCode
()
.
' '
.
$app
[
'request'
]
->
getMethod
()
.
' '
.
$app
[
'request'
]
->
getRequestUri
());
}
else
{
$app
[
'monolog'
]
->
addError
(
$e
->
getMessage
());
...
...
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