lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r889033 - /lucene/lucy/trunk/perl/lib/Lucy.pm
Date Thu, 10 Dec 2009 00:27:20 GMT
Author: marvin
Date: Thu Dec 10 00:27:20 2009
New Revision: 889033

URL: http://svn.apache.org/viewvc?rev=889033&view=rev
Log:
Fix Perl implementation for Json_spew_json to always set Err_error before
returning false.  Fix Perl binding for ByteBuf's deserialization.

Modified:
    lucene/lucy/trunk/perl/lib/Lucy.pm

Modified: lucene/lucy/trunk/perl/lib/Lucy.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/perl/lib/Lucy.pm?rev=889033&r1=889032&r2=889033&view=diff
==============================================================================
--- lucene/lucy/trunk/perl/lib/Lucy.pm (original)
+++ lucene/lucy/trunk/perl/lib/Lucy.pm Thu Dec 10 00:27:20 2009
@@ -37,7 +37,7 @@
 }
 
 {
-    package KinoSearch::Object::ByteBuf;
+    package Lucy::Object::ByteBuf;
     {
         # Override autogenerated deserialize binding.
         no warnings 'redefine';
@@ -205,9 +205,21 @@
         }
         my $outstream = $args{folder}->open_out( $args{path} );
         return 0 unless $outstream;
-        $outstream->print($json);
-        eval { $outstream->close; };
-        return 0 if $@;
+        eval {
+            $outstream->print($json);
+            $outstream->close;
+        };
+        if ($@) {
+            my $error;
+            if ( blessed($@) && $@->isa("Lucy::Object::Err") ) {
+                $error = $@;
+            }
+            else {
+                $error = Lucy::Object::Err->new($@);
+            }
+            Lucy::Object::Err->set_error($error);
+            return 0;
+        }
         return 1;
     }
 



Mime
View raw message