Branch 'kolab-syncroton-2.2' - lib/ext
Aleksander Machniak
machniak at kolabsys.com
Thu Feb 5 12:32:57 CET 2015
lib/ext/Syncroton/Command/FolderCreate.php | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit ede2171abef6b4880a8f3b18241e49919770b82f
Author: Aleksander Machniak <alec at alec.pl>
Date: Thu Jan 29 14:13:20 2015 +0100
Handle exceptions in FolderCreate with valid status response (#4410)
diff --git a/lib/ext/Syncroton/Command/FolderCreate.php b/lib/ext/Syncroton/Command/FolderCreate.php
index e7eda47..1c73efb 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;
@@ -66,11 +66,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);
@@ -92,7 +91,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;
More information about the commits
mailing list