From 434d990ca1d9d5c15b8ee61cb08d23850b4dc04d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Apr 2011 18:43:31 +0000 Subject: [PATCH] Add warning --- htdocs/core/class/html.formsms.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 3043cd1712f..ffa065d2470 100755 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -174,11 +174,19 @@ function limitChars(textarea, limit, infodiv) if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') { dol_include_once('/ovh/class/ovhsms.class.php'); - $sms = new OvhSms($db); - $resultsender = $sms->SmsSenderList($conf->global->OVHSMS_ACCOUNT); + try + { + $sms = new OvhSms($db); + $resultsender = $sms->SmsSenderList($conf->global->OVHSMS_ACCOUNT); + } + catch(Exception $e) + { + dol_print_error('','Error to get list of senders: '.$e->getMessage()); + } } else { + dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE"); $resultsender[0]->number=$this->fromsms; } if (sizeof($resultsender) > 0)