1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-27 07:33:05 +00:00

fix check error message

This commit is contained in:
adrien 2014-01-16 23:33:40 +01:00
parent 77412b4794
commit 2199e8cf8a

View file

@ -63,7 +63,7 @@ class Sync
@socket.puts send_msg.to_json @socket.puts send_msg.to_json
msg = JSON.parse(@socket.gets) msg = JSON.parse(@socket.gets)
if !msg['error'] if !defined?(msg['error'])
@error_msg = I18n.t('error.sync.communication') @error_msg = I18n.t('error.sync.communication')
return nil return nil
elsif msg['error'].nil? elsif msg['error'].nil?
@ -74,6 +74,7 @@ class Sync
@mpw = MPW.new(tmp_file) @mpw = MPW.new(tmp_file)
if !@mpw.decrypt(gpg_password) if !@mpw.decrypt(gpg_password)
puts @mpw.error_msg
return nil return nil
end end
@ -103,7 +104,7 @@ class Sync
@socket.puts send_msg.to_json @socket.puts send_msg.to_json
msg = JSON.parse(@socket.gets) msg = JSON.parse(@socket.gets)
if !msg['error'] if !defined?(msg['error'])
@error_msg = I18n.t('error.sync.communication') @error_msg = I18n.t('error.sync.communication')
return false return false
elsif msg['error'].nil? elsif msg['error'].nil?