-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Console] ViewManager hides exceptions in console #6866
Comments
I welcome your thoughts on that. Meanwhile, here's a dirty workaround: public function onBootstrap(MvcEvent $e)
{
$sm = $e->getApplication()->getServiceManager();
// Fix exceptions not displaying in console
if (Console::isConsole()) {
/** @var ViewManager $vm */
$vm = $sm->get('ViewManager');
$vm->getExceptionStrategy()->setDisplayExceptions(true);
}
} |
+1 |
I'm for this solution |
What about console-specific configs with 'console' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
], |
+1 for @texdc idea, except maybe should be all 'console' => [
'router' => [
// …stuff
],
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
]
] |
@texdc The actual implementation sits in a console-specific ViewManager, which is very similar to standard http ViewManager so I want to keep it consistent. That means, that @jeremiahsmall is on the money with how we should probably nest it (which is in-line with how we nest console router config) @weierophinney as you're the original ViewManager author, do you have anything against me separating those ViewManager configs? |
@Thinkscape @jeremiahsmall 👍 nested is fine with me. |
👍 I have found this issue to be a pain in the ****** |
@Thinkscape separating configs based on context makes a ton of sense to me. |
Handled in #6951 |
Le awesome! |
This is what bugs me very often:
Because in production we'll usually see:
... it will also affect console rendering of exceptions. It's not easily solvable when using config caching, because tricks like conditionals in config files are uncacheable.
I see couple of solutions:
display_exceptions_console
.The text was updated successfully, but these errors were encountered: