OpenInteract::Error::Main - Catches all errors and dispatches to proper handler


OpenInteract documentation  | view source Contained in the OpenInteract distribution.

Index


NAME

Top

OpenInteract::Error::Main - Catches all errors and dispatches to proper handler

SYNOPSIS

Top

 $R->throw( { code => 412, type => 'db' } );

DESCRIPTION

Top

This class catches all errors thrown by the framework. It then inspects the error, reviews the current context and decides which class and method should handle the error.

To do this, it needs to be able to determine a few things:

The main method, catch(), determines the context in which the error was thrown. (This should be simple: just ask $R.) It then determines which error handler(s) should be queried as to whether it/they can deal with the error thrown.

The last entry in the list of error handlers should always be the default system catalog of error handlers. They may be generic, but they can catch any error and return something more meaningful than 'Internal Systen Error.'

METHODS

Top

catch( $err )

Discussed above.

initialize( { config = $C } )>

Should be called from the Apache child init handler. In your startup file, be sure to add something like this:

 Apache->push_handlers( PerlChildInitHandler => sub {
   ...blah blah blah...

   OpenInteract::Error::Main->initialize( { config => $C } );

   ...blah blah blah...
  }
 )

This initializes the class with information from all the packages, including the handlers they intend to use for their errors.

TO DO

Top

Nothing.

BUGS

Top

None known.

COPYRIGHT

Top

AUTHORS

Top

Chris Winters <chris@cwinters.com>


OpenInteract documentation  | view source Contained in the OpenInteract distribution.