diff options
author | dartcafe <github@dartcafe.de> | 2020-11-03 00:14:39 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2020-11-03 00:14:39 +0300 |
commit | e5c6f0ccaa1a158d09d5e574779527a1c3a52cf0 (patch) | |
tree | c79b49f9339978a729e83c2992b922858a104f38 /lib/Model/Contact.php | |
parent | 24db4090cb59b004fda183a161c2738976b633ae (diff) |
refactor exceptions
Diffstat (limited to 'lib/Model/Contact.php')
-rw-r--r-- | lib/Model/Contact.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Model/Contact.php b/lib/Model/Contact.php index d718595c..2470cdbd 100644 --- a/lib/Model/Contact.php +++ b/lib/Model/Contact.php @@ -24,7 +24,7 @@ namespace OCA\Polls\Model; use OCA\Polls\Exceptions\MultipleContactsFound; -use OCA\Polls\Exceptions\ContactsNotEnabled; +use OCA\Polls\Exceptions\ContactsNotEnabledExceptions; class Contact extends UserGroupClass { public const TYPE = 'contact'; @@ -79,6 +79,7 @@ class Contact extends UserGroupClass { /** * loadContact * @NoAdminRequired + * @throws MultipleContactsFound * The contacts app just provides a search, so we have to load the contact * after searching via the contact's id and use the first contact. * @@ -101,6 +102,11 @@ class Contact extends UserGroupClass { $this->contact = $contacts[0]; } + /** + * getContact + * @NoAdminRequired + * @throws ContactsNotEnabledExceptions + */ private function getContact() { if (\OC::$server->getAppManager()->isEnabledForUser('contacts')) { $this->resolveContactId(); @@ -131,7 +137,7 @@ class Contact extends UserGroupClass { $this->description = \OC::$server->getL10N('polls')->t('Contact'); } } else { - throw new ContactsNotEnabled(); + throw new ContactsNotEnabledExceptions(); } } |