Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle SmsError exception in sms-cli

  • Loading branch information...
commit 62c53b8d4815a9886ccf6bd660d422ef5cb88249 1 parent f17c1d9
@mludvig authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 sms-cli
View
11 sms-cli
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.