Skip to content

Commit

Permalink
Merge pull request #134 from igor-khripun/patch-1
Browse files Browse the repository at this point in the history
Clear Imap Errors
  • Loading branch information
barbushin authored Aug 13, 2016
2 parents 0b2e430 + a11db0a commit 949826c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PhpImap/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public function switchMailbox($imapPath = '') {
protected function initImapStream() {
$imapStream = @imap_open($this->imapPath, $this->imapLogin, $this->imapPassword, $this->imapOptions, $this->imapRetriesNum, $this->imapParams);
if(!$imapStream) {
throw new Exception('Connection error: ' . imap_last_error());
$lastError = imap_last_error();
imap_errors();
throw new Exception('Connection error: ' . $lastError);
}
return $imapStream;
}
Expand Down

0 comments on commit 949826c

Please sign in to comment.