Here are graphs on how the system in the Error Handling branch works:

http://www.andrewdasilva.com/incubator/ErrorHandling1.png
http://www.andrewdasilva.com/incubator/ErrorHandling2.png

Only thing to work out is the template system...

On Sep 15, 10:38 pm, Andrew da Silva <[EMAIL PROTECTED]> wrote:
> In an effort to finally have a discussion onerrorhandling, I present
> you a series of questions and suggestions based on various readings.
> As a disclaimer, this is in no way a formal suggestion since I am not
> an expert but only the messenger. Please suggest your own concepts or
> designs on how we should handle errors in Habari.
>
> Questions
> - Do we want to use severity? (ErrorException object)
> - If yes, do we want to support nesting of exceptions to build higher
> severity exceptions?
> - Do we want HTML in _core_errorhandle?
> - Should we keep an in-file revision number for debug information?
>
> Suggested Guidelines
> -Errorhandlingclasses must be independent of other classes.
> - Create anerrordescription template.
> - Document exceptions using phpDoc @throws.
> - No more white pages!!!
> - For backward-compatibility, we can’t changeerrorhandlingmethod
> names or inheritance (e.g, Exception rather than DBException)
>
> Error Object
> - Can derive more specializederrorclasses from it. (per plugin to
> support customerrorhandlers - e.g, ThemeError, ThemeException,
> PluginError, PluginException)
> - Extend with special methods to convert an instance to a string.
> - Encapsulate the following data: line number, method name, class
> name, file name, revision anderrordescription. (most already
> available in an Exception/ErrorException object)
> - Add the methods: addUserInfo() and getUserInfo().
>
> LogEntry Object
> - Logs theErrorObject.
>
> ErrorHandler
> - UsesErrorto displayerrormessages.
> - Uses LogEntry to logerrormessages.
> - Provide a defaulterrorhandler. (to define, default behavior)
> - Configurable:handlingmodes (return, print, die, etc.), etc.
>
> Suggested Design:
> 1. Throw ErrorException/[Custom]Exception with message template.
> 2. On object creation, LogEntry logs theerrormessage accordingly.
> 3. The Exception is passes through the chain oferrorhandlers,
> ErrorHandler for unhandled exceptions.
> 4. ErrorHandler, depending onhandlingmode prints, dies, etc. (could
> call a filter hook)
> 5. If ErrorHandler is in returns, caller handles theerrorand can
> recover. (custom handlers could recover)
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to