Skip to content

Commit

Permalink
Raise a temporary failure error if we lost the imap connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 10, 2017
1 parent dcf8027 commit 58937ba
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -347,6 +347,8 @@ protected function _wantPlainText($html_id, $want_html)
* - text_id (string) The MIME id of the plain part, if any.
*
* @return Horde_Imap_Client_Data_Fetch The results.
* @throws Horde_ActiveSync_Exception,
* Horde_ActiveSync_Exception_EmailFatalFailure
*/
protected function _fetchData(array $params)
{
Expand Down Expand Up @@ -378,6 +380,10 @@ protected function _fetchData(array $params)
array('ids' => new Horde_Imap_Client_Ids(array($this->_uid)))
);
} catch (Horde_Imap_Client_Exception $e) {
// If we lost the connection, don't continue to try.
if ($e->getCode() == Horde_Imap_Client_Exception::DISCONNECT) {
throw new Horde_ActiveSync_Exception_TemporaryFailure($e->getMessage());
}
throw new Horde_ActiveSync_Exception($e);
}
if (!$data = $fetch_ret->first()) {
Expand Down

0 comments on commit 58937ba

Please sign in to comment.