Title: [925] trunk/image_voodoo/lib/image_voodoo.rb: Fix a couple more tests by handling native exceptions better
Revision
925
Author
nicksieger
Date
2008-03-04 16:48:31 -0500 (Tue, 04 Mar 2008)

Log Message

Fix a couple more tests by handling native exceptions better

Modified Paths


Diff

Modified: trunk/image_voodoo/lib/image_voodoo.rb (924 => 925)


--- trunk/image_voodoo/lib/image_voodoo.rb	2008-03-04 21:41:00 UTC (rev 924)
+++ trunk/image_voodoo/lib/image_voodoo.rb	2008-03-04 21:48:31 UTC (rev 925)
@@ -51,6 +51,8 @@
     graphics.dispose
       
     yield ImageVoodoo.new(target)
+  rescue NativeException => ne
+    raise ArgumentError, ne.message
   end
   
   def greyscale
@@ -95,6 +97,8 @@
   def self.with_image(file)
     image = ImageIO.read(JFile.new(file))
     yield ImageVoodoo.new(image)
+  rescue NativeException => ne
+    raise TypeError, ne.message
   end
 
   def self.with_bytes(bytes)
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to