summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-29 13:13:20 (GMT)
committerAleksander Machniak <alec@alec.pl>2015-01-29 13:13:20 (GMT)
commitdcfe0e76868afeb8352f8b766e2fdea26ae80a6f (patch)
treeac7b5c8190da245ecddb32440482ab45f760d295
parent9ad07b2dd17d080fa6c737cd0897f33e4bb7b1f1 (diff)
downloadkolab-syncroton-dcfe0e76868afeb8352f8b766e2fdea26ae80a6f.tar.gz
Handle exceptions in FolderCreate with valid status response (#4410)
-rw-r--r--lib/ext/Syncroton/Command/FolderCreate.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ext/Syncroton/Command/FolderCreate.php b/lib/ext/Syncroton/Command/FolderCreate.php
index f3787f3..f1764d5 100644
--- a/lib/ext/Syncroton/Command/FolderCreate.php
+++ b/lib/ext/Syncroton/Command/FolderCreate.php
@@ -15,13 +15,13 @@
* @package Syncroton
* @subpackage Command
*/
-class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml
-{
+class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml
+{
protected $_defaultNameSpace = 'uri:FolderHierarchy';
protected $_documentElement = 'FolderCreate';
/**
- *
+ *
* @var Syncroton_Model_Folder
*/
protected $_folder;
@@ -70,11 +70,10 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml
break;
default:
- throw new Syncroton_Exception_UnexpectedValue('invalid type defined');
- break;
+ // unsupported type
+ return;
}
-
$dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp);
$this->_folder = $dataController->createFolder($folder);
@@ -96,7 +95,8 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml
if ($this->_logger instanceof Zend_Log)
$this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed.");
$folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY));
-
+ } else if (!$this->_folder) {
+ $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR));
} else {
$this->_syncState->counter++;
$this->_syncState->lastsync = $this->_syncTimeStamp;