mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-02-07 01:54:16 +01:00
Do more error checking. Refs. #367
This commit is contained in:
parent
a8de751533
commit
b81a475b78
@ -122,6 +122,9 @@ class Shared extends Database {
|
|||||||
$permissions = $addressBook['permissions'];
|
$permissions = $addressBook['permissions'];
|
||||||
|
|
||||||
$card = parent::getContact($addressbookid, $id, $options);
|
$card = parent::getContact($addressbookid, $id, $options);
|
||||||
|
if(!$card) {
|
||||||
|
throw new \Exception('Shared Contact not found: ' . implode(',', $id), 404);
|
||||||
|
}
|
||||||
$card['permissions'] = $permissions;
|
$card['permissions'] = $permissions;
|
||||||
return $card;
|
return $card;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,11 @@ class Backend extends \Sabre_CardDAV_Backend_Abstract {
|
|||||||
*/
|
*/
|
||||||
public function getCard($addressbookid, $carduri) {
|
public function getCard($addressbookid, $carduri) {
|
||||||
list($id, $backend) = $this->getBackendForAddressBook($addressbookid);
|
list($id, $backend) = $this->getBackendForAddressBook($addressbookid);
|
||||||
$contact = $backend->getContact($id, array('uri' => urldecode($carduri)));
|
try {
|
||||||
|
$contact = $backend->getContact($id, array('uri' => urldecode($carduri)));
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
throw new \Sabre_DAV_Exception_NotFound($e->getMessage());
|
||||||
|
}
|
||||||
return ($contact ? $contact : false);
|
return ($contact ? $contact : false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user