lib/ext
Aleksander Machniak
machniak at kolabsys.com
Thu Jan 29 14:13:49 CET 2015
lib/ext/Syncroton/Command/FolderCreate.php | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit dcfe0e76868afeb8352f8b766e2fdea26ae80a6f
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 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;
More information about the commits
mailing list