Changeset 57

Show
Ignore:
Timestamp:
02/20/06 22:54:24 (3 years ago)
Author:
miya
Message:

patch from Brian.Adds some basic error handling.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • atom_client/trunk/lib/AtomClient.pm

    r56 r57  
    5454sub end : Private { 
    5555    my ( $self, $c ) = @_; 
     56 
     57    if( @{ $c->error } ) { 
     58        $c->res->status( 500 ); 
     59        $c->stash->{ errors } = $c->error; 
     60        $c->error( 0 ); 
     61        $c->stash->{ template } = 'error.tt'; 
     62        $c->forward( $c->view( 'TT' ) ); 
     63        return 1; 
     64    } 
     65 
    5666    $c->stash->{template} = $c->action . '.tt'; 
    57     $c->forward('AtomClient::View::TT'); 
     67    $c->forward( $c->view( 'TT' ) ); 
    5868} 
    5969