-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Catch \Throwable #18812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch \Throwable #18812
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; | ||
| use Symfony\Component\HttpFoundation\Request; | ||
| use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; | ||
| use Symfony\Component\Routing\Exception\RouteNotFoundException; | ||
| use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||
|
|
||
| /** | ||
|
|
@@ -193,8 +194,8 @@ public function toolbarAction(Request $request, $token) | |
| $url = null; | ||
| try { | ||
| $url = $this->generator->generate('_profiler', array('token' => $token)); | ||
| } catch (\Exception $e) { | ||
| // the profiler is not enabled | ||
| } catch (RouteNotFoundException $e) { | ||
| // the named route doesn't exist => the profiler is not enabled | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now don't catch other exceptions (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but does that happen?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fprochazka let's stay on the safe side
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so I'll add all 3 of them? Or do I revert this for now?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's revert
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nicolas-grekas @fabpot It doesn't look like this change was reverted before merging... just thought you'd want to know.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping @nicolas-grekas You merged this one.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nvm, false alarm. Unless the |
||
| } | ||
|
|
||
| return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in php7 isn't possible implements
\Throwableinterface only extends\Exceptionclass, so why not use only one catch with\Throwable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we support PHP5 also
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it