From c66fe77f88b9ba15178d9716ca83456b79717c73 Mon Sep 17 00:00:00 2001 From: nishiki Date: Sat, 31 Aug 2013 23:20:59 +0200 Subject: [PATCH] add error messages --- MPW.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MPW.rb b/MPW.rb index 23bc5b6..e89b3e7 100644 --- a/MPW.rb +++ b/MPW.rb @@ -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}!"