X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=d54d2ea2e7abcca3c22b0c20a66375013bc56a87;hp=9249f1c0d1b04a11b4a8f21fb6227da4a97cedda;hb=196932def5cc8ade4af7e52b40cc61bd460ee69d;hpb=c4586fd07d4c17c49b4da9c224c6dcf1a782a099 diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 9249f1c..d54d2ea 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -225,7 +225,7 @@ Documented in L sub go { my $self = shift; $self->_do_visit('go', @_); - die $Catalyst::GO; + Catalyst::Exception::Go->throw; } =head2 $self->forward( $c, $command [, \@arguments ] ) @@ -271,7 +271,7 @@ Documented in L sub detach { my ( $self, $c, $command, @args ) = @_; $self->_do_forward(detach => $c, $command, @args ) if $command; - die $Catalyst::DETACH; + Catalyst::Exception::Detach->throw; } sub _action_rel2abs { @@ -654,12 +654,11 @@ sub _load_dispatch_types { my ( $self, @types ) = @_; my @loaded; - # Preload action types for my $type (@types) { - my $class = - ( $type =~ /^\+(.*)$/ ) ? $1 : "Catalyst::DispatchType::${type}"; - + # first param is undef because we cannot get the appclass + my $class = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $type); + eval { Class::MOP::load_class($class) }; Catalyst::Exception->throw( message => qq/Couldn't load "$class"/ ) if $@; @@ -682,9 +681,8 @@ of course it's being used.) sub dispatch_type { my ($self, $name) = @_; - unless ($name =~ s/^\+//) { - $name = "Catalyst::DispatchType::" . $name; - } + # first param is undef because we cannot get the appclass + $name = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $name); for (@{ $self->_dispatch_types }) { return $_ if ref($_) eq $name;