summaryrefslogtreecommitdiff
path: root/lib/kolab_sync_data_email.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-30 12:41:13 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-08-30 12:41:13 (GMT)
commit866e8e53f953d415a8fbbba155e90805a6878ed0 (patch)
tree8db8147fe79e8cc7e0d4558695bd40094227ee12 /lib/kolab_sync_data_email.php
parent71cc2c50f97fa886a0423e8cd036813ee837f232 (diff)
downloadkolab-syncroton-866e8e53f953d415a8fbbba155e90805a6878ed0.tar.gz
Improved error handling in moveItems command handler
Diffstat (limited to 'lib/kolab_sync_data_email.php')
-rw-r--r--lib/kolab_sync_data_email.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
index eb63e9d..0d62a8c 100644
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -412,6 +412,7 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
* @param string $serverId Object identifier
* @param string $dstFolderId Destination folder identifier
*
+ * @throws Syncroton_Exception_Status
* @return string New object identifier
*/
public function moveItem($srcFolderId, $serverId, $dstFolderId)
@@ -419,12 +420,16 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
$msg = $this->parseMessageId($serverId);
$dstname = $this->backend->folder_id2name($dstFolderId, $this->device->deviceid);
+ if (empty($msg)) {
+ throw Syncroton_Exception_Status_MoveItems(Syncroton_Exception_Status_MoveItems::INVALID_SOURCE);
+ }
+
if ($dstname === null) {
- return;
+ throw Syncroton_Exception_Status_MoveItems(Syncroton_Exception_Status_MoveItems::INVALID_DESTINATION);
}
if (!$this->storage->move_message($msg['uid'], $dstname, $msg['foldername'])) {
- return;
+ throw Syncroton_Exception_Status_MoveItems(Syncroton_Exception_Status_MoveItems::INVALID_SOURCE);
}
// Use COPYUID feature (RFC2359) to get the new UID of the copied message