This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit a16c0ce22f3a490e7d79414923e5bd17ac8f7b74
Author: Dominique Dumont <d...@debian.org>
Date:   Sun Jan 24 12:30:58 2016 +0100

    Removed calls to Exception::Class->caught...
    
    I've removed Exception::Class from Config::Model. This change is
    compatible with old and new Config::Model.
---
 lib/Config/Model/Backend/Dpkg.pm       | 11 +++++++----
 lib/Config/Model/Backend/Dpkg/Patch.pm | 13 +++++++------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lib/Config/Model/Backend/Dpkg.pm b/lib/Config/Model/Backend/Dpkg.pm
index 82ae0b0..0bebccb 100644
--- a/lib/Config/Model/Backend/Dpkg.pm
+++ b/lib/Config/Model/Backend/Dpkg.pm
@@ -50,8 +50,8 @@ sub read_patch_series {
         next unless $pname =~ /\w/;    # skip empty lines
         my $obj = $hash->fetch_with_id($pname);
         eval { $obj->init; };
-        my $e;
-        if ($e = Exception::Class->caught('Config::Model::Exception::Syntax')) 
{
+        my $e = $@;
+        if (ref($e) and $e ->isa('Config::Model::Exception::Syntax')) {
             if ( $args->{check} eq 'yes' ) {
                 my $msg = $e ->message. ". Use -force option to override" ;
                 ref($e) -> throw(message => $msg);
@@ -61,8 +61,11 @@ sub read_patch_series {
             }
             $hash->delete($pname);
         }
-        elsif ( $e = Exception::Class->caught() ) {
-            ref $e ? $e->rethrow : die $e;
+        elsif (ref($e)) {
+            $e->rethrow ;
+        }
+        elsif ($e) {
+            die $e;
         }
         elsif ($logger->is_info) {
             my $location = $obj->name;
diff --git a/lib/Config/Model/Backend/Dpkg/Patch.pm 
b/lib/Config/Model/Backend/Dpkg/Patch.pm
index e6b5e26..3d28442 100644
--- a/lib/Config/Model/Backend/Dpkg/Patch.pm
+++ b/lib/Config/Model/Backend/Dpkg/Patch.pm
@@ -80,16 +80,17 @@ sub read {
 
     if (@$header) {
         $c = eval { $self->parse_dpkg_lines( $header, $check, 0, $store_stuff 
); };
-        my $e;
-        if ( $e = Exception::Class->caught('Config::Model::Exception::Syntax') 
)
-        {
-
+        my $e = $@;
+        if ( ref($e) and $e->isa('Config::Model::Exception::Syntax') ) {
             # FIXME: this is naughty. Should file a bug to add info in rethrow
             $e->{parsed_file} = $patch_file unless $e->parsed_file;
             $e->rethrow;
         }
-        elsif ( $e = Exception::Class->caught() ) {
-            ref $e ? $e->rethrow : die $e;
+        elsif (ref($e)) {
+            $e->rethrow;
+        }
+        elsif ($e) {
+            die $e;
         }
 
         Config::Model::Exception::Syntax->throw(

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to