From 1ab3c7e0b0ac69cff28b5f56a209426c9c1791a1 Mon Sep 17 00:00:00 2001 From: nishiki Date: Wed, 29 Jan 2014 22:49:13 +0100 Subject: [PATCH] change rescue --- MPW/Sync/MPW.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/MPW/Sync/MPW.rb b/MPW/Sync/MPW.rb index da72e43..054fa28 100644 --- a/MPW/Sync/MPW.rb +++ b/MPW/Sync/MPW.rb @@ -35,14 +35,12 @@ module MPW @password = password @suffix = suffix - begin - @socket = TCPSocket.new(host, port) - @enable = true - rescue Exception => e - @error_msg = "#{I18n.t('error.sync.connection')}\n#{e}" - @enable = false - end - + @socket = TCPSocket.new(host, port) + @enable = true + rescue Exception => e + @error_msg = "#{I18n.t('error.sync.connection')}\n#{e}" + @enable = false + else return @enable end