use FindBin;
use Template;
use Catalyst;
+use Catalyst::Exception;
my %cache;
$self->{appprefix} = lc $self->{dir};
$self->{appprefix} =~ s/-/_/g;
$self->{startperl} = $Config{startperl};
- $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN;
+ $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
$self->{author} = $self->{author} = $ENV{'AUTHOR'}
|| eval { @{ [ getpwuid($<) ] }[6] }
|| 'Catalyst developer';
my @args = @_;
my $class = "Catalyst::Helper::$helper";
eval "require $class";
- die qq/Couldn't load helper "$class", "$@"/ if $@;
+
+ if ( $@ ) {
+ Catalyst::Exception->throw(
+ message => qq/Couldn't load helper "$class", "$@"/
+ );
+ }
+
if ( $class->can('mk_stuff') ) {
return 1 unless $class->mk_stuff( $self, @args );
}
$comp = 'Controller' if $type eq 'C';
my $class = "Catalyst::Helper::$comp\::$helper";
eval "require $class";
- die qq/Couldn't load helper "$class", "$@"/ if $@;
+
+ if ( $@ ) {
+ Catalyst::Exception->throw(
+ message => qq/Couldn't load helper "$class", "$@"/
+ );
+ }
+
if ( $class->can('mk_compclass') ) {
return 1 unless $class->mk_compclass( $self, @args );
}
print qq/ exists "$dir"\n/;
return 0;
}
- if ( mkpath $dir) {
+ if ( mkpath [$dir] ) {
print qq/created "$dir"\n/;
return 1;
}
- die qq/Couldn't create "$dir", "$!"/;
+
+ Catalyst::Exception->throw(
+ message => qq/Couldn't create "$dir", "$!"/
+ );
}
=head3 mk_file
print qq/created "$file"\n/;
return 1;
}
- die qq/Couldn't create "$file", "$!"/;
+
+ Catalyst::Exception->throw(
+ message => qq/Couldn't create "$file", "$!"/
+ );
}
=head3 next_test
}
=back
+
[% END %]
=head1 AUTHOR