Chris Winters > OpenInteract-1.62 > OpenInteract::Error::Main

Download:
OpenInteract-1.62.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 1.07   Source  

NAME ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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 ^

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 ^

Nothing.

BUGS ^

None known.

COPYRIGHT ^

Copyright (c) 2001-2002 intes.net, inc.. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS ^

Chris Winters <chris@cwinters.com>