PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Queue » Bug #7850

constructor doesn't return PEAR Error Object

Details

Submitted2006-06-09 15:01 UTC
Fromhkrems at yahoo dot de
Assignedtill
StatusClosed
PackageMail_Queue
PHP Version5.1.2
OSMax OS X
Roadmaps1.2.3

Comments

[2006-06-09 15:01 UTC] hkrems at yahoo dot de

Description:
------------
creating an instance of Mail_Queue with invalid dsn did not
return a PEAR Error.

Test script:
---------------
$db_options['type'] = 'db';
$db_options['dsn'] = 'mysql://user:pass@localhost/test'.'ERROR'; // << generate error
$db_options['mail_table'] = 'mail_queue';
$mail_options['driver'] = 'sendmail';
$mail_options['host'] = 'localhost';
$mail_options['port'] = 25;
$mail_options['auth'] = false;
$mail_queue =& new Mail_Queue($db_options, $mail_options);
if(PEAR::isError($mail_queue)) die ($mail_queue->getMessage());

Expected result:
----------------
final words: "Mail Queue Error: Cannot connect to database"

Actual result:
--------------
PEAR::isError($mail_queue) simply returned FALSE

[2006-06-13 08:02 UTC] hkrems at yahoo dot de

I have tested it with the latest CVS versions (I think):
Queue.php,v 1.16
Body.php,v 1.10
Container.php,v 1.9
db.php,v 1.20

the only way to check if there is an error is like

if(PEAR::isError($mail_queue->container->db))
{
print ('<h1>ERROR</h1>');
}