$self->render( result => $res->json )
1 2 3 4
# Handle errors my $error = undef; return $self->render(template => 'error', message => $error) if $error;
1 2 3 4 5 6 7
# Search result if (my $res = $tx->success) { return $self->render( result => $res->json ); } my ($message, $code) = $tx->error; return $self->render(template => 'error', message => $message);