Here is code from CMS of my site:
function errorHandler($errno, $errstr, $errfile, $errline) {
   throw new Exception($errstr, $errno);
}
set_error_handler('errorHandler');

... skip initialization code ....

       try {
           $front->dispatch();
       } catch (Exception $e) {
           if ($e instanceof Zend_Controller_Dispatcher_Exception) {
               $front->setRequest(new
Zend_Controller_Request_Http(MYSPHERE_URL . '/error/error404'));
               $front->dispatch();
           } elseif ('debug' == $config->mode) {
               throw $e;
           } else {
               $front->setRequest(new
Zend_Controller_Request_Http(MYSPHERE_URL . '/error/error500'));
               $front->dispatch();
           }
       }


Sincerely,

On 3/22/07, Juan Felipe Alvarez Saldarriaga <[EMAIL PROTECTED]> wrote:

Hey :)

Im traying to make my own exception handler, I set a global exception
handler function, "set_exception_handler( 'exceptionHandler' )", to deal
with the "throw Exception()" command, so when the Exception "jumps" to
this function I want to show all the Exception information into a view,
but how to redirect this data to a view ? I mean, how to call a
Controller there ? this function is defined on the bootstrap index.php,
so I try to do something like that:

Define a global method to deal with the exceptions, this method is on
the bootstrap index.php.
In this function I make a Zend::loadClass( 'ExceptionHandler' ); this
class is where Im going to send an email or something and off course
show some Exceptions attributes, like the line of the error and stuff
like that. But cause this class is not part of the framework I can't
never load a controller to instance an action there an then show this
information into a view. Somebody can help me on this ?

Thx.




--
Alexander
http://www.alexatnet.com/ - Blog and CMS created with Zend Framework and
Ajax.

Reply via email to