Skip to content

Commit e5b5099

Browse files
author
Sebastian Krätzig
committed
Add examples for the new ConnectionException::getErrors() function
1 parent f4b1716 commit e5b5099

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ try {
9797
// PHP.net imap_search criteria: http://php.net/manual/en/function.imap-search.php
9898
$mailsIds = $mailbox->searchMailbox('ALL');
9999
} catch(PhpImap\Exceptions\ConnectionException $ex) {
100-
echo "IMAP connection failed: " . $ex;
100+
echo "IMAP connection failed: " . implode(",", $ex->getErrors('all'));
101101
die();
102102
}
103103

examples/get_and_parse_unseen_emails.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
try {
2424
$mail_ids = $mailbox->searchMailbox('UNSEEN');
2525
} catch (ConnectionException $ex) {
26-
exit('IMAP connection failed: '.$ex->getMessage());
26+
exit('IMAP connection failed: '.$ex->getErrors('first'));
2727
} catch (Exception $ex) {
2828
exit('An error occured: '.$ex->getMessage());
2929
}

0 commit comments

Comments
 (0)