Permalink
Browse files

adds rescue block to catch modem exceptions

  • Loading branch information...
1 parent 9fb6c25 commit 0dbb5275819dee98456c5917541b7fc64f949ac6 funkaster committed Sep 28, 2009
Showing with 11 additions and 3 deletions.
  1. +11 −3 app/servers/local_sms_proxy.rb
@@ -12,12 +12,20 @@ def initialize(modem)
end
def sms(number, text)
- @modem.sms(number, text)
+ begin
+ @modem.sms(number, text)
+ rescue Exception => e
+ Lokii::Logger.warn "ERROR when sending sms: #{e.message} (#{err.class})"
+ end
end
def messages
- @modem.process
- @modem.messages || []
+ begin
+ @modem.process
+ @modem.messages || []
+ rescue Exception => e
+ Lokii::Logger.warn "ERROR when fetching messages: #{e.message} (#{err.class})"
+ end
end
end
end

0 comments on commit 0dbb527

Please sign in to comment.