[ditz-talk] [PATCH 2/2] Name plugin load error so it gets rescue'd

Daniel Kalør daniel at kalor.dk
Thu Nov 27 18:57:42 EST 2008


---
 bin/ditz    |    2 +-
 lib/ditz.rb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ditz b/bin/ditz
index 84ee25f..04bc7a6 100755
--- a/bin/ditz
+++ b/bin/ditz
@@ -90,7 +90,7 @@ end
 
 begin
   Ditz::load_plugins $opts[:plugins_file]
-rescue SystemCallError => e
+rescue LoadError => e
   Ditz::debug "can't load plugins file: #{e.message}"
 end
 
diff --git a/lib/ditz.rb b/lib/ditz.rb
index 0ec7f77..5a5b88a 100644
--- a/lib/ditz.rb
+++ b/lib/ditz.rb
@@ -46,7 +46,7 @@ end
 ## my brilliant solution to the 'gem datadir' problem
 def find_ditz_file fn
   dir = $:.find { |p| File.exist? File.expand_path(File.join(p, fn)) }
-  raise "can't find #{fn} in any load path" unless dir
+  raise LoadError, "can't find #{fn} in any load path" unless dir
   File.expand_path File.join(dir, fn)
 end
 
-- 
1.6.0.3



More information about the ditz-talk mailing list