From 2199e8cf8a4bba39fe624a4a03f60a8d4def8d2b Mon Sep 17 00:00:00 2001 From: adrien Date: Thu, 16 Jan 2014 23:33:40 +0100 Subject: [PATCH] fix check error message --- lib/Sync.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Sync.rb b/lib/Sync.rb index a02a08d..2fa8ec7 100644 --- a/lib/Sync.rb +++ b/lib/Sync.rb @@ -63,7 +63,7 @@ class Sync @socket.puts send_msg.to_json msg = JSON.parse(@socket.gets) - if !msg['error'] + if !defined?(msg['error']) @error_msg = I18n.t('error.sync.communication') return nil elsif msg['error'].nil? @@ -74,6 +74,7 @@ class Sync @mpw = MPW.new(tmp_file) if !@mpw.decrypt(gpg_password) + puts @mpw.error_msg return nil end @@ -103,7 +104,7 @@ class Sync @socket.puts send_msg.to_json msg = JSON.parse(@socket.gets) - if !msg['error'] + if !defined?(msg['error']) @error_msg = I18n.t('error.sync.communication') return false elsif msg['error'].nil?