From: Vincent Pit Date: Tue, 23 Feb 2010 00:34:49 +0000 (+0100) Subject: Replace croak() by Carp::confess() X-Git-Tag: v0.07~25 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=5b2d059b23a0c56067d68d072a4df7b638ac94c3;p=perl%2Fmodules%2Frgit.git Replace croak() by Carp::confess() --- diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index 348b8c4..fa98b6e 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -3,7 +3,7 @@ package App::Rgit::Command; use strict; use warnings; -use Carp qw/croak/; +use Carp (); use App::Rgit::Utils qw/:codes/; @@ -50,11 +50,12 @@ sub new { if ($class eq __PACKAGE__) { $class = $action; } else { - croak "Command $cmd should be executed as a $action" - unless $class->isa($action); + Carp::confess("Command $cmd should be executed as a $action") + unless $class->isa($action); } - eval "require $action; 1" or croak "Couldn't load $action: $@"; + eval "require $action; 1" or Carp::confess("Couldn't load $action: $@"); + bless { cmd => $cmd, args => $args{args} || [ ], diff --git a/lib/App/Rgit/Config.pm b/lib/App/Rgit/Config.pm index 1cac51d..073f3ca 100644 --- a/lib/App/Rgit/Config.pm +++ b/lib/App/Rgit/Config.pm @@ -3,7 +3,7 @@ package App::Rgit::Config; use strict; use warnings; -use Carp qw/croak/; +use Carp (); use Cwd qw/abs_path/; use File::Spec::Functions qw/file_name_is_absolute/; @@ -60,7 +60,7 @@ sub new { } my $conf = 'App::Rgit::Config::Default'; - eval "require $conf; 1" or croak "Couldn't load $conf: $@"; + eval "require $conf; 1" or Carp::confess("Couldn't load $conf: $@"); my $r = App::Rgit::Repository->new(fake => 1); return unless defined $r; diff --git a/lib/App/Rgit/Utils.pm b/lib/App/Rgit/Utils.pm index cfe191d..2e310f6 100644 --- a/lib/App/Rgit/Utils.pm +++ b/lib/App/Rgit/Utils.pm @@ -3,8 +3,6 @@ package App::Rgit::Utils; use strict; use warnings; -use Carp qw/croak/; - =head1 NAME App::Rgit::Utils - Miscellaneous utilities for App::Rgit classes.