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 2012/07/24 01:25:05 UTC
[lucy-commits] svn commit: r1364838 - in /lucy/trunk: core/Clownfish/Err.cfh
perl/buildlib/Lucy/Build/Binding/Object.pm
Author: marvin
Date: Mon Jul 23 23:25:05 2012
New Revision: 1364838
URL: http://svn.apache.org/viewvc?rev=1364838&view=rev
Log:
LUCY-242 Update Err documentation.
Modified:
lucy/trunk/core/Clownfish/Err.cfh
lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm
Modified: lucy/trunk/core/Clownfish/Err.cfh
URL: http://svn.apache.org/viewvc/lucy/trunk/core/Clownfish/Err.cfh?rev=1364838&r1=1364837&r2=1364838&view=diff
==============================================================================
--- lucy/trunk/core/Clownfish/Err.cfh (original)
+++ lucy/trunk/core/Clownfish/Err.cfh Mon Jul 23 23:25:05 2012
@@ -29,13 +29,8 @@ __END_C__
/**
* Exception.
*
- * Most of the time when Lucy encounters an error, it tries to raise a
- * Clownfish::Err exception with an error message and context
- * information.
- *
- * At present, it is only safe to catch exceptions which are specifically
- * documented as catchable; most times when an Err is raised, Lucy leaks
- * memory.
+ * Clownfish::Err is the base class for exceptions in the Clownfish object
+ * hierarchy.
*
* The Err module also provides access to a per-thread Err shared variable via
* set_error() and get_error(). It may be used to store an Err object
Modified: lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm
URL: http://svn.apache.org/viewvc/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm?rev=1364838&r1=1364837&r2=1364838&view=diff
==============================================================================
--- lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm (original)
+++ lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm Mon Jul 23 23:25:05 2012
@@ -193,19 +193,23 @@ END_XS_CODE
sub bind_err {
my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
my $synopsis = <<'END_SYNOPSIS';
+ package MyErr;
+ use base qw( Clownfish::Err );
+
+ ...
+
+ package main;
use Scalar::Util qw( blessed );
- my $bg_merger;
while (1) {
- $bg_merger = eval {
- Lucy::Index::BackgroundMerger->new( index => $index );
+ eval {
+ do_stuff() or MyErr->throw("retry");
};
- last if $bg_merger;
- if ( blessed($@) and $@->isa("Lucy::Store::LockErr") ) {
+ if ( blessed($@) and $@->isa("MyErr") ) {
warn "Retrying...\n";
}
else {
# Re-throw.
- die "Failed to open BackgroundMerger: $@";
+ die "do_stuff() died: $@";
}
}
END_SYNOPSIS