[Catalyst] How to manage error 404

Albert Vila avp at imente.com
Fri Jul 1 16:41:58 CEST 2005


Thanks Sebastian, this solution works for me.

Sebastian Riedel wrote:

>
> Am 28.06.2005 um 12:02 schrieb Chisel Wright:
>
>> On Tue, Jun 28, 2005 at 11:52:23AM +0200, Albert Vila wrote:
>>
>>> I've I do this, how can I serve the default http://localhost:3000 ?
>>>
>>>
>>>> sub default : Private {
>>>>   my ( $self, $c ) = @_;
>>>>     # use the default 404 page for the server
>>>>   $c->res->status(404);
>>>>     # make sure we have no action
>>>>   $c->req->action(undef);
>>>> }
>>>>
>>
>>  sub default : Private {
>>   my ( $self, $c ) = @_;
>>
>>   if ($c->req->action eq 'default') {
>>    $c->forward($whatever);
>>   }
>>
>>   $c->res->status(404);
>>   $c->req->action(undef);
>>  }
>>
>> perhaps?
>
>
> I would just use:
>
>     sub default : Private {
>         my ( $self, $c, $something ) = @_;
>         if ($something) {
>             $c->res->status(404);
>             # ...
>         }
>         else {
>             # do something to handle root
>         }
>     }
>
>
> -- 
> sebastian
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
>

-- 
Albert Vila
Director de proyectos I+D
http://www.imente.com
902 933 242
[iMente La información con más beneficios]




More information about the Catalyst mailing list