From e03839838e898b2140514cf2b135a90d57c61efd Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 27 Apr 2013 03:05:06 +0200 Subject: [PATCH] Contacts: Throw exception on missing parameters. --- lib/contact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/contact.php b/lib/contact.php index 97757f76..76974d68 100644 --- a/lib/contact.php +++ b/lib/contact.php @@ -421,17 +421,17 @@ class Contact extends VObject\VCard implements IPIMObject { if(is_array($value)) { $property->setParts($value); } else { - debug('Saving ADR ' . $value); + //debug('Saving ADR ' . $value); $property->setValue($value); } break; case 'IMPP': if(is_null($parameters) || !isset($parameters['X-SERVICE-TYPE'])) { - bailOut(App::$l10n->t('Missing IM parameter.')); + throw new \InvalidArgumentException(__METHOD__.' Missing IM parameter for: '.$name. ' ' . $value); } $impp = Utils\Properties::getIMOptions($parameters['X-SERVICE-TYPE']); if(is_null($impp)) { - bailOut(App::$l10n->t('Unknown IM: '.$parameters['X-SERVICE-TYPE'])); + throw new \UnexpectedValueException(__METHOD__.'Unknown IM: ' . $parameters['X-SERVICE-TYPE']); } $value = $impp['protocol'] . ':' . $value; $property->setValue($value);