Permalink
Browse files

Handle SmsError exception in sms-cli

  • Loading branch information...
1 parent f17c1d9 commit 62c53b8d4815a9886ccf6bd660d422ef5cb88249 @mludvig committed Feb 17, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 sms-cli
View
@@ -76,7 +76,14 @@ if not options.message or not options.recipients:
error('Message and at least one recipient must be set!')
sys.exit(1)
-sms = SmsSender()
-sms.send(message = options.message, recipients = options.recipients)
+try:
+ sms = SmsSender()
+ sms.send(message = options.message, recipients = options.recipients)
+except SmsConfigError, e:
+ error("Config file error: %s" % e)
+ sys.exit(1)
+except SmsException, e:
+ error(e)
+ sys.exit(1)
# vim:et:ts=4:sts=4:ai

0 comments on commit 62c53b8

Please sign in to comment.