Page 1 of 1

How to catch exceptions??

Posted: Tue Feb 17, 2009 1:28 pm
by grvulture
why isn't this working???

Code: Select all

 try {
    if ($server) $smtp =& new Swift_Connection_SMTP($server); else $smtp =& new Swift_Connection_SMTP("localhost");
    if ($smtp_user) $smtp->setUsername($smtp_user);
    if ($password) $smtp->setpassword($password);
  } catch (Exception $e) {
    $this->setMessage ( 'Caught exception: '. $e->getMessage() );
    return;
  }
 
instead of catching it, I get a
Fatal error: Uncaught exception 'Swift_ConnectionException' with message 'Authentication failed using username
...and I'm :banghead:

Re: How to catch exceptions??

Posted: Tue Feb 17, 2009 1:52 pm
by grvulture
ok, I need to sleep! can't see the obvious before my eyes

ignore the topic....

sorry :roll: