r26652 - in /trunk/libexception-class-trycatch-perl: Changes META.yml README debian/changelog debian/copyright lib/Exception/Class/TryCatch.pm lib/Exception/Class/TryCatch.pod t/01_Exception_Class_TryCatch.t

ghostbar-guest at users.alioth.debian.org ghostbar-guest at users.alioth.debian.org
Tue Nov 4 05:07:11 UTC 2008


Author: ghostbar-guest
Date: Tue Nov  4 05:07:05 2008
New Revision: 26652

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26652
Log:
Refreshed debian/copyright
New upstream release

Modified:
    trunk/libexception-class-trycatch-perl/Changes
    trunk/libexception-class-trycatch-perl/META.yml
    trunk/libexception-class-trycatch-perl/README
    trunk/libexception-class-trycatch-perl/debian/changelog
    trunk/libexception-class-trycatch-perl/debian/copyright
    trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pm
    trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pod
    trunk/libexception-class-trycatch-perl/t/01_Exception_Class_TryCatch.t

Modified: trunk/libexception-class-trycatch-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/Changes?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/Changes (original)
+++ trunk/libexception-class-trycatch-perl/Changes Tue Nov  4 05:07:05 2008
@@ -1,4 +1,9 @@
 Revision history for Perl module Exception::Class::TryCatch
+
+1.12 Mon Nov  3 17:12:19 EST 2008
+
+    - Changed: if no exception was thrown, catch() returns an empty array
+      in list context
 
 1.11 Tue Sep 30 12:21:56 EDT 2008
 

Modified: trunk/libexception-class-trycatch-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/META.yml?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/META.yml (original)
+++ trunk/libexception-class-trycatch-perl/META.yml Tue Nov  4 05:07:05 2008
@@ -1,6 +1,6 @@
 ---
 name: Exception-Class-TryCatch
-version: 1.11
+version: 1.12
 author:
   - 'David Golden <dagolden at cpan.org>'
 abstract: Syntactic tryE<sol>catch sugar for use with Exception::Class
@@ -15,7 +15,7 @@
 provides:
   Exception::Class::TryCatch:
     file: lib/Exception/Class/TryCatch.pm
-    version: 1.11
+    version: 1.12
 generated_by: Module::Build version 0.3
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: trunk/libexception-class-trycatch-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/README?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/README (original)
+++ trunk/libexception-class-trycatch-perl/README Tue Nov  4 05:07:05 2008
@@ -3,7 +3,7 @@
     Exception::Class
 
 VERSION
-    This documentation describes version 1.11.
+    This documentation describes version 1.12.
 
 SYNOPSIS
          use Exception::Class::TryCatch;
@@ -80,10 +80,11 @@
          catch my $err, [ 'Exception::Type', 'Exception::Other::Type' ];
 
     Returns an "Exception::Class::Base" object (or an object which is a
-    subclass of it) if an exception has been caught by "eval" or else
-    returns "undef" if no error exists. The exception is either popped from
-    a hidden error stack (see "try") or, if the stack is empty, taken from
-    the current value of $@.
+    subclass of it) if an exception has been caught by "eval". If no
+    exception was thrown, it returns "undef" in scalar context and an empty
+    list in list context. The exception is either popped from a hidden error
+    stack (see "try") or, if the stack is empty, taken from the current
+    value of $@.
 
     If the exception is not an "Exception::Class::Base" object (or subclass
     object), an "Exception::Class::Base" object will be created using the

Modified: trunk/libexception-class-trycatch-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/debian/changelog?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/debian/changelog (original)
+++ trunk/libexception-class-trycatch-perl/debian/changelog Tue Nov  4 05:07:05 2008
@@ -1,8 +1,5 @@
-libexception-class-trycatch-perl (1.11-1) UNRELEASED; urgency=low
+libexception-class-trycatch-perl (1.12-1) UNRELEASED; urgency=low
 
-  TODO:
-  debian/copyright: years and license (!) have changed
-  
   [ Jose Luis Rivas ]
   * New upstream release
   * Switched to debhelper 7.
@@ -14,7 +11,7 @@
   * debian/rules: use the template from dh-make-perl
   * Don't install README any more (text version of POD documentation).
 
- -- Jose Luis Rivas <ghostbar38 at gmail.com>  Sat, 01 Nov 2008 19:47:22 -0430
+ -- Jose Luis Rivas <ghostbar38 at gmail.com>  Tue, 04 Nov 2008 00:36:07 -0430
 
 libexception-class-trycatch-perl (1.10-1) unstable; urgency=low
 

Modified: trunk/libexception-class-trycatch-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/debian/copyright?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/debian/copyright (original)
+++ trunk/libexception-class-trycatch-perl/debian/copyright Tue Nov  4 05:07:05 2008
@@ -1,4 +1,5 @@
-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
+Format-Specification:
+    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
 Upstream-Author: David A Golden <dagolden at cpan.org>
 Packaged-By: Jaldhar H. Vyas <jaldhar at debian.org>
 Original-Source-Location: http://search.cpan.org/dist/Exception-Class-TryCatch/
@@ -6,14 +7,14 @@
 Original-Source-Depends: devscripts
 
 Files: *
-Copyright © 2004, 2005, 2006 by David A. Golden
+Copyright © 2004-2008 by David A. Golden
 License: GPL-1+ | Artistic
  This program is free software; you can redistribute
  it and/or modify it under the same terms as Perl itself.
 
 Files: debian/*
 Copyright: © 2008 Jaldhar H. Vyas <jaldhar at debian.org>
-           © 2008 Debian Perl Group <debian-perl at lists.debian.org>
+           © 2008 Jose Luis Rivas <ghostbar38 at gmail.com>
 License: GPL-1+ | Artistic
 
 Perl is distributed under your choice of the GNU General Public License or

Modified: trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pm?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pm (original)
+++ trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pm Tue Nov  4 05:07:05 2008
@@ -6,7 +6,7 @@
 
 package Exception::Class::TryCatch;
 
-$VERSION     = '1.11';
+$VERSION     = '1.12';
 @ISA         = qw (Exporter);
 @EXPORT      = qw ( catch try );
 @EXPORT_OK   = qw ( caught );
@@ -45,7 +45,7 @@
             $e->rethrow() unless grep { $e->isa($_) } @{$_[0]};
         }
     }
-    return $e;
+    return wantarray ? ( $e ? ($e) : () ) : $e;
 }
 
 *caught = \&catch;
@@ -151,11 +151,11 @@
     # two argument form
     catch my $err, [ 'Exception::Type', 'Exception::Other::Type' ];
 
-Returns an {Exception::Class::Base} object (or an object which is a 
-subclass of it) if an exception has been caught by {eval} or else 
-returns {undef} if no error exists.  The exception is either popped
-from a hidden error stack (see {try}) or, if the stack is empty, taken from
-the current value of {$@}.
+Returns an {Exception::Class::Base} object (or an object which is a subclass of
+it) if an exception has been caught by {eval}.  If no exception was thrown, it
+returns {undef} in scalar context and an empty list in list context.   The
+exception is either popped from a hidden error stack (see {try}) or, if the
+stack is empty, taken from the current value of {$@}.
 
 If the exception is not an {Exception::Class::Base} object (or subclass
 object), an {Exception::Class::Base} object will be created using the string

Modified: trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pod?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pod (original)
+++ trunk/libexception-class-trycatch-perl/lib/Exception/Class/TryCatch.pod Tue Nov  4 05:07:05 2008
@@ -8,7 +8,7 @@
 
 =head1 VERSION
 
-This documentation describes version 1.11.
+This documentation describes version 1.12.
 
 =head1 SYNOPSIS
 
@@ -86,11 +86,11 @@
      # two argument form
      catch my $err, [ 'Exception::Type', 'Exception::Other::Type' ];
 
-Returns an C<<< Exception::Class::Base >>> object (or an object which is a 
-subclass of it) if an exception has been caught by C<<< eval >>> or else 
-returns C<<< undef >>> if no error exists.  The exception is either popped
-from a hidden error stack (see C<<< try >>>) or, if the stack is empty, taken from
-the current value of C<<< $@ >>>.
+Returns an C<<< Exception::Class::Base >>> object (or an object which is a subclass of
+it) if an exception has been caught by C<<< eval >>>.  If no exception was thrown, it
+returns C<<< undef >>> in scalar context and an empty list in list context.   The
+exception is either popped from a hidden error stack (see C<<< try >>>) or, if the
+stack is empty, taken from the current value of C<<< $@ >>>.
 
 If the exception is not an C<<< Exception::Class::Base >>> object (or subclass
 object), an C<<< Exception::Class::Base >>> object will be created using the string

Modified: trunk/libexception-class-trycatch-perl/t/01_Exception_Class_TryCatch.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libexception-class-trycatch-perl/t/01_Exception_Class_TryCatch.t?rev=26652&op=diff
==============================================================================
--- trunk/libexception-class-trycatch-perl/t/01_Exception_Class_TryCatch.t (original)
+++ trunk/libexception-class-trycatch-perl/t/01_Exception_Class_TryCatch.t Tue Nov  4 05:07:05 2008
@@ -1,7 +1,7 @@
 # Exception::Class::TryCatch  
 use strict;
 
-use Test::More tests =>  42 ;
+use Test::More tests =>  45 ;
 
 use Exception::Class::TryCatch qw( try catch caught );
 use Exception::Class 'My::Exception::Class', 'My::Other::Exception';
@@ -126,6 +126,23 @@
 catch $err;
 is ( $rv, undef, "try gets undef on exception" );
 is ( $err->error, 'error', "simple try/catch works" );
+
+#--------------------------------------------------------------------------#
+# Test try/catch to array
+#--------------------------------------------------------------------------#
+
+$rv = try eval { My::Exception::Class->throw( "error" ) };
+my @err = catch;
+is ( scalar @err, 1, '@array = catch' );
+is ( $err[0]->error, 'error', 'array catch works' );
+
+#--------------------------------------------------------------------------#
+# Test try/catch to array -- no error
+#--------------------------------------------------------------------------#
+
+$rv = try eval { 42 };
+ at err = catch;
+is ( scalar @err, 0, 'array catch with no error returns empty array' );
 
 #--------------------------------------------------------------------------#
 # Test multiple try/catch with double error




More information about the Pkg-perl-cvs-commits mailing list