mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 03:06:02 +03:00
Updated Message class to throw exception when passed nonexistant email ID
This commit is contained in:
parent
7af83a84db
commit
0bbc02b006
@ -175,7 +175,8 @@ class Message
|
||||
$this->imapConnection = $mailbox;
|
||||
$this->uid = $messageUniqueId;
|
||||
$this->imapStream = $this->imapConnection->getImapStream();
|
||||
$this->loadMessage();
|
||||
if($this->loadMessage() !== true)
|
||||
throw new \RuntimeException('Message with ID ' . $messageUniqueId . ' not found.');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +189,8 @@ class Message
|
||||
|
||||
/* First load the message overview information */
|
||||
|
||||
$messageOverview = $this->getOverview();
|
||||
if(!is_object($messageOverview = $this->getOverview()))
|
||||
return false;
|
||||
|
||||
$this->subject = $messageOverview->subject;
|
||||
$this->date = strtotime($messageOverview->date);
|
||||
@ -225,6 +227,8 @@ class Message
|
||||
foreach ($structure->parts as $id => $part)
|
||||
$this->processStructure($part, $id + 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user