mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-17 08:30:04 +00:00
add error messages
This commit is contained in:
parent
499039585a
commit
c66fe77f88
1 changed files with 4 additions and 0 deletions
4
MPW.rb
4
MPW.rb
|
@ -79,6 +79,7 @@ class MPW
|
||||||
@timeout_pwd = config['config']['timeout_pwd'].to_i
|
@timeout_pwd = config['config']['timeout_pwd'].to_i
|
||||||
|
|
||||||
if @key.empty? || @file_gpg.empty? || @file_pwd.empty?
|
if @key.empty? || @file_gpg.empty? || @file_pwd.empty?
|
||||||
|
@error_msg = "Checkconfig failed!"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -107,6 +108,7 @@ class MPW
|
||||||
file_pwd.close
|
file_pwd.close
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
|
@error_msg = "Can't decrypt file!"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -121,6 +123,7 @@ class MPW
|
||||||
id += 1;
|
id += 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
rescue
|
rescue
|
||||||
if !@file_pwd.nil? && File.exist?(@file_pwd)
|
if !@file_pwd.nil? && File.exist?(@file_pwd)
|
||||||
|
@ -299,6 +302,7 @@ class MPW
|
||||||
file << "#{row.join(',')}\n"
|
file << "#{row.join(',')}\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
rescue
|
rescue
|
||||||
@error_msg = "Can't export, impossible to write in #{file}!"
|
@error_msg = "Can't export, impossible to write in #{file}!"
|
||||||
|
|
Loading…
Add table
Reference in a new issue