rkingon / Craft-Plugin--Redirect-Manager

MIT License
46 stars 16 forks source link

Craft throws an exception if a redirect happens #23

Open kaspar-allenbach opened 8 years ago

kaspar-allenbach commented 8 years ago

Hi.

We monitor our craft website now with new relic.

What we can see now is that if a redirect gets triggered a error appears:

Craft\HttpException: Uncaught exception 'Craft\HttpException' with message '' in /server_path/new/craft/app/controllers/TemplatesController.php:59

in Craft\TemplatesController::actionRender called at ? (?) in ReflectionMethod::invokeArgs called at /server_path/craft/app/framework/web/actions/CAction.php (109) in CAction::runWithParamsInternal called at /server_path/craft/app/framework/web/actions/CInlineAction.php (47) in CInlineAction::runWithParams called at /server_path/craft/app/framework/web/CController.php (308) in CController::runAction called at /server_path/craft/app/framework/web/CController.php (286) in CController::runActionWithFilters called at /server_path/craft/app/framework/web/CController.php (265) in CController::run called at /server_path/craft/app/framework/web/CWebApplication.php (282) in CWebApplication::runController called at /server_path/craft/app/framework/web/CWebApplication.php (141) in CWebApplication::processRequest called at /server_path/craft/app/etc/web/WebApp.php (288) in Craft\WebApp::processRequest called at /server_path/craft/app/framework/base/CApplication.php (185) in CApplication::run called at /server_path/craft/app/index.php (62) in require_once called at /server_path/www/index.php (19)

But the redirect is successfull so everything is good. I wonder if this is a issue with your plugin or with craft itsself. Do you know anything about this?

rkingon commented 8 years ago

Check to make sure you're on the latest version. This should have been fixed in 6794069bb79a03f9b051d0db3527fb6d12a8c671

kaspar-allenbach commented 8 years ago

I'm on Redirec Manager 1.9.1 and Craft CMS 2.6.2773

rkingon commented 8 years ago

I didn't re-version it on that update. Can you check line 50 of redirectmanager/RedirectManagerPlugin.php and see if it includes: $event->handled = true; ? thanks!

bstein-clever commented 6 years ago

I just discovered I'm having this issue, too, which I think is causing some related issues, though it might just be a red herring. Definitely getting stack traces, and $event->handled is set to true, as on master. It looks like the craft stack trace is happening first? Any additional thoughts?

Yes, I know we should eventually upgrade to Craft 3, but some of the plugins we need for our side aren't available yet.

rkingon commented 6 years ago

hey @bstein-clever - i haven't opened a php file in quite sometime, a PR would be welcomed if you can figure out what is going on :)

bstein-clever commented 6 years ago

I don't have a solution - as far as I can tell, it looks like craft is dumping the stack trace before your code is ever hit, so I'm not even sure it's possible. I don't have the time to dig into it right now, but I figured I'd check to see if anyone else had had any success.