From 6d9c813562aa9949ba754c8ebec22b943d6e9042 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Tue, 25 Feb 2014 13:42:25 +0100 Subject: [PATCH] Raise error instead of calling exit unconditionally --- pws.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pws.rb b/pws.rb index 739b208..f153ef7 100755 --- a/pws.rb +++ b/pws.rb @@ -248,8 +248,7 @@ class GroupConfig begin f = File.open(@trusted_users) rescue Exception => e - STDERR.puts e - exit(1) + raise e end trusted = [] @@ -281,7 +280,7 @@ class GroupConfig STDERR.puts stderrtxt STDERR.puts "and via statusfd:" STDERR.puts statustxt - exit(1) + raise "Not goodsig" end if not trusted.include?(validsig) @@ -289,8 +288,7 @@ class GroupConfig end if not exitstatus==0 - STDERR.puts "gpg verify failed for .users file" - exit(1) + raise "gpg verify failed for .users file" end return outtxt @@ -300,8 +298,7 @@ class GroupConfig begin f = File.open(File.join(@dirname, '.users')) rescue Exception => e - STDERR.puts e - exit(1) + raise e end users = f.read -- 2.39.5