Permalink
Browse files

Merge pull request #2 from mattn/destroy_session

Ignore exception to continue re-connection
  • Loading branch information...
2 parents 7e96f59 + d3c1ec2 commit ff34e7fc09c1aad1155030a9e62477ff670db5c1 @psychs committed Mar 26, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 lingr.rb
View
10 lingr.rb
@@ -193,8 +193,12 @@ def create_session
def destroy_session
debug { "requesting session/destroy" }
- res = post("session/destroy", :session => @session)
- debug { "session/destroy response: #{res.inspect}" }
+ begin
+ res = post("session/destroy", :session => @session)
+ debug { "session/destroy response: #{res.inspect}" }
+ rescue Exception => e
+ log_error { "error in destroy_session: #{e.inspect}" }
+ end
@session = nil
@nickname = nil
@public_id = nil
@@ -203,8 +207,6 @@ def destroy_session
@username = nil
@rooms = {}
res
- rescue Exception => e
- log_error { "error in destroy_session: #{e.inspect}" }
end
def set_presence(presence)

0 comments on commit ff34e7f

Please sign in to comment.