[GSoC 2009] Improved Error Handling

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Apr 27, 2009 3:37 pm

[GSoC 2009] Improved Error Handling

Post by Ryan_R » Mon Apr 27, 2009 3:57 pm

Hi all. My name is Ryan and I'm another student participating in the '09 Summer of Code. My student proposal for this summer covers improving the J! error handling in regards to HTTP status codes (200, 404, etc) and setting up a plug-in for an easily customized error handling page. The following is some pieces of my student proposal (mostly minus the personal details). I expect to be updating this plan quite a bit over the next few weeks!

With current Joomla! releases, end-users are faced with a shortage of options when dealing with http response status codes. Errors are not handled uniformly throughout Joomla!, and no framework within Joomla! exists to modify error pages. The goal of this project is to work with other developers to ensure that errors are handled consistently throughout Joomla!, to ensure that Joomla! returns the correct status code, and to allow users to setup customized error pages via a plugin.

When viewing this problem, I have found it helpful to break the viewer into 3 categories: a user, a robot, and an admin. A unique response is required for each viewer:

* a user needs to be notified that an error has occurred, and be presented with options to find what they were looking for.
* a robot needs to receive the correct status code for the type of error received.
* an admin who's concerned about security would like to minimize the amount of information given to unauthorized users. Ex: instead of returning a 403, return a 404 so that the existence of a page is neither confirmed nor denied.

All of these issues can be handled with one error page and it seems unnecessarily complicated to create different error pages for each status code. The final goal for this project will be an error page plugin for Joomla! The features this error page plugin will include:

* a default error page that utilizes current template styles, navigation, and site search if available.
* customizable error messages based on the status code, and the ability to redirect specific urls to different pages (ie, always redirect idnex.php to index.php).
* will return the appropriate status code so that it may correctly be identified by robots.
* admins will have the option to mask 403 errors as 404 errors for security (possibly other maskings).
*All error page visits will be output to a seperate log file since these errors will no longer show in Apache's log.
* Extend the existing JError class to deal with these errors.

In addition to this plugin, it will be important to ensure that Joomla! always points to the correct error page. This is important whether or not the additional error page plugin is installed, as it is my understanding from various forums that Joomla does not handle errors consistently. In order to accomplish this:

* A set of test conditions will be developed to cover and document the various ways errors are thrown/handled (if time permits, it would be beneficial to script this test)
* Using these results, the existing Joomla! code will be modified to handle all errors in one consistent manner. At this point I do not intend to modify the way Joomla! handles these errors, only to ensure that it is done consistently.
* A patch file will be created and released for additional testing and (hopeful) implementation.

Note that when I refer to error handling, I specifically refer to handling http response status codes. Handling all of Joomla's errors is, unfortunately, outside the scope of this project. =)


Return to “Joomla! 1.5 Coding”