summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-11-06 13:04:59 (GMT)
committerAleksander Machniak <alec@alec.pl>2014-11-06 13:04:59 (GMT)
commitd880f3b571020adfcefe22050cd17411fa785af7 (patch)
tree4e13ac86d88eb95a9648b456722c0800d0a4c363
parent92b081cf384a7c5158a2852f52a3c11a717f936a (diff)
downloadkolab-syncroton-d880f3b571020adfcefe22050cd17411fa785af7.tar.gz
Correctly throw exception when fetching non-existent email message (#3579)
Otherwise we hit PHP fatal error which effectively stops synchronization.
-rw-r--r--lib/kolab_sync_data_email.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
index 381c3cf..8c3a820 100644
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -124,9 +124,9 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
{
$message = $this->getObject($serverId);
- if (empty($message)) {
- // @TODO: exception
- return;
+ // error (message doesn't exist?)
+ if (empty($message) || empty($message->headers)) {
+ throw new Syncroton_Exception_NotFound("Message $serverId not found");
}
$msg = $this->parseMessageId($serverId);