Hi there,
we use Catalyst about year and one thing make a lot of pain. When you
make typo in action attribute name Catalyst silently eat it. For
example:

sub foo : Loacal Arg(1) {

}

will be work, but Arg(1) just do nothing.

Now we use few additional attributes and I add trivial check in
Our::Catalyst::Action:

    my @correct_names = qw<
        Path
        Private
        Global
        Local
        Regex
        LocalRexgex
        Args
        Chained
        CaptureArgs
        PathPart

        Method
        Secure
        UnSecure
        RestrictTo
        Crumb
        Test
       >;

    foreach my $name (keys %$attrs) {
        unless ( first { $name eq $_ } @correct_names ) {
            die "Wrong trait (attribute) $name!";
        }
    }

so it is work for us, but mb better to add something like this in
Catalyst itself? I can make patch if this helps.

Excuse my ugly English, plz.

Ilya

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to