You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2009/12/10 01:27:20 UTC
svn commit: r889033 - /lucene/lucy/trunk/perl/lib/Lucy.pm
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;
}