fix error message when sync
This commit is contained in:
parent
684972e440
commit
ea9b2fb411
1 changed files with 8 additions and 4 deletions
|
@ -48,22 +48,26 @@ class Cli
|
||||||
|
|
||||||
if @sync.enable
|
if @sync.enable
|
||||||
if !@mpw.sync(@sync.get(@passwd), @config.last_update)
|
if !@mpw.sync(@sync.get(@passwd), @config.last_update)
|
||||||
puts "#{I18n.t('display.error')}: #{@sync.error_msg}"
|
puts "#{I18n.t('display.error')}: #{@mpw.error_msg}" if !@mpw.error_msg.nil?
|
||||||
|
puts "#{I18n.t('display.error')}: #{@sync.error_msg}" if !@sync.error_msg.nil?
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if !@sync.update(File.open(@config.file_gpg).read)
|
if !@sync.update(File.open(@config.file_gpg).read)
|
||||||
puts "#{I18n.t('display.error')}: #{@sync.error_msg}"
|
puts "#{I18n.t('display.error')}: #{@sync.error_msg}"
|
||||||
elsif !@config.set_last_update
|
elsif !@config.set_last_update
|
||||||
puts "#{I18n.t('display.error')}: #{@config.error_msg}"
|
puts "#{I18n.t('display.error')}: #{@config.error_msg}"
|
||||||
|
elsif !@mpw.encrypt
|
||||||
|
puts "#{I18n.t('display.error')}: #{@mpw.error_msg}"
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
puts "#{I18n.t('display.error')}: #{e}"
|
puts "#{I18n.t('display.error')}: #{e}"
|
||||||
puts @sync.error_msg
|
puts @sync.error_msg if @sync.error_msg.nil?
|
||||||
puts @config.error_msg
|
puts @config.error_msg if @config.error_msg.nil?
|
||||||
puts @mpw.error_msg
|
puts @mpw.error_msg if @mpw.error_msg.nil?
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue