hi,
I noticed special behaviour of agavi that I think is not well designed...ok, let's begin:

in my app I created a special exception class that has, besides the normal message, another message string that will be sent to the admin. this allows me to have user friendly messages and specific messages for me with additional data.

what I did next was this:

try {
   ConfigCache::import('config/defines.ini');
Context::getInstance()->getController()->dispatch();
} catch (CFException $e) {
   mail(..., $e->getAdminMessage(), ...);
$e = new AgaviException($e->getMessage()); $e->printStackTrace(); } catch (AgaviException $e) { $e->printStackTrace();
} catch (Exception $e) {
// unknown exception $e = new AgaviException($e->getMessage()); // btw this was not correct...agavi generated this code: $e->printStackTrace(new AgaviException($e->getMessage()));
   $e->printStackTrace();
}


to test it I simply threw a CFException from somewhere...but what a surprise, no email! after checking some stuff I took a look into
FrontwebController::dispatch() and there was the reason:

   public function dispatch ()
   {
       try {
           ...

       } catch (AgaviException $e) {
           $e->printStackTrace();

       } catch (Exception $e) {
           // most likely an exception from a third-party library
           $e = new AgaviException($e->getMessage());

           $e->printStackTrace();
       }
   }

so you don't have a chance to provide your own catch-handler!

--
mfg Steven Weiß


-------------------------------------------------
Steven Weiß
code-factory - Programming, Webdesign, PC-Service

Anton-Uhrenbacherstr. 10
77977 Rust

Telefon:   (07822) 440668
Handy:     (0178) 3832347
[EMAIL PROTECTED]
http://www.code-factory.de
-------------------------------------------------



_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to