Closed gabriel403 closed 10 years ago
What kind of error messages?
[Wed Jun 05 16:00:29 2013] [error] [client 10.11.12.1] PHP Fatal error: Uncaught exception 'b8\Exception\HttpException\BadRequestException' with message 'Invalid controller [\PHPCI\Controller\Favicon.icoController]: Favicon.ico does not exist.' in /code/PHPCI/vendor/block8/b8framework/b8/Application.php:87\nStack trace:\n#0 /code/PHPCI/vendor/block8/b8framework/b8/Application.php(66): b8\Application->initController()\n#1 /code/PHPCI/PHPCI/Application.php(30): b8\Application->initRequest()\n#2 /code/PHPCI/index.php(18): PHPCI\Application->handleRequest()\n#3 {main}\n thrown in /code/PHPCI/vendor/block8/b8framework/b8/Application.php on line 87
Maybe the b8 framework should return 404 if a controller is requested that can't be found.
I haven't thought this through fully but it seems sensible.
Yeh sounds reasonable to me
if !fileExist
send 404
else
instanciate
@dancryer think this is something you fix in the b8 framework? 404 instead of exception?
Should be able to catch the exception in phpci::application and then update the response object response code to 404...
On Tuesday, 11 June 2013, Gabriel Baker wrote:
@dancryer https://github.com/dancryer think this is something you fix in the b8 framework? 404 instead of exception?
— Reply to this email directly or view it on GitHubhttps://github.com/Block8/PHPCI/issues/71#issuecomment-19293187 .
Dan Cryer Director Block 8 Limited
07590 698944 dan.cryer@block8.co.uk @block8digital http://www.twitter.com/block8digital
Maybe certain filetype requests shouldn't ever be sent to the index.php?
That would just be a server-level config option. The easiest way to solve this one particular issue, given that it is favicons, would just be to add a favicon.
Will put something together and commit it shortly.
I did add a blank favicon ages ago but think it got skipped out as part of a merge, but to me it makes more sense to 404 on an incorrect url than to throw an exception and cease execution.
It does. :) I'll have a look at it.
When running PHP with all errors on, the lack of a favicon keeps causing error messages, it also seems to stop the redirect when doing a build, I have to manually go to the build rather than being redirected.