Skip to content

Commit

Permalink
Throw an exception if we required a synckey, but do not have one.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Mar 25, 2014
1 parent c331801 commit 16952b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Collections.php
Expand Up @@ -279,6 +279,7 @@ public function addCollection(array $collection, $requireSyncKey = false)
synckey could be found. Most likely a client error in
requesting a collection during PING before it has issued a
SYNC.', $this->_procid));
throw new Horde_ActiveSync_Exception_StateGone('Synckey required in Horde_ActiveSync_Collections::addCollection, but none was found.');
}

$this->_logger->info(sprintf(
Expand All @@ -291,7 +292,12 @@ public function addCollection(array $collection, $requireSyncKey = false)
if (empty($collection['class'])) {
$collection['class'] = $this->getCollectionClass($collection['id']);
}
$collection['serverid'] = $this->getBackendIdForFolderUid($collection['id']);

try {
$collection['serverid'] = $this->getBackendIdForFolderUid($collection['id']);
} catch (Horde_ActiveSync_Exception $e) {
throw new Horde_ActiveSync_Exception_StateGone($e->getMessage());
}

$this->_collections[$collection['id']] = $collection;
$this->_logger->info(sprintf(
Expand Down

0 comments on commit 16952b4

Please sign in to comment.