From 9ebe5da9948cb93eb56ab5afe0082169d36b4e76 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 16 Jan 2013 00:10:27 +0100 Subject: [PATCH] Improved error handling. --- lib/session.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/session.rb b/lib/session.rb index f4f2f98a1..3f68d8ffb 100644 --- a/lib/session.rb +++ b/lib/session.rb @@ -94,7 +94,9 @@ module Session def self.jobs # just make sure that spool path exists - FileUtils.mkpath @path + if !File::exists?( @path ) + FileUtils.mkpath @path + end Thread.abort_on_exception = true while true @@ -147,6 +149,12 @@ module Session def self.sessions path = @path + '/' + + # just make sure that spool path exists + if !File::exists?( path ) + FileUtils.mkpath path + end + data = [] Dir.foreach( path ) do |entry| if entry != '.' && entry != '..'