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

add error messages

This commit is contained in:
nishiki 2013-08-31 23:20:59 +02:00
parent 499039585a
commit c66fe77f88

4
MPW.rb
View file

@ -79,6 +79,7 @@ class MPW
@timeout_pwd = config['config']['timeout_pwd'].to_i
if @key.empty? || @file_gpg.empty? || @file_pwd.empty?
@error_msg = "Checkconfig failed!"
return false
end
@ -107,6 +108,7 @@ class MPW
file_pwd.close
end
rescue
@error_msg = "Can't decrypt file!"
return false
end
@ -121,6 +123,7 @@ class MPW
id += 1;
end
end
return true
rescue
if !@file_pwd.nil? && File.exist?(@file_pwd)
@ -299,6 +302,7 @@ class MPW
file << "#{row.join(',')}\n"
end
end
return true
rescue
@error_msg = "Can't export, impossible to write in #{file}!"