Skip to content

Commit

Permalink
Stargazers controller file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Talina06 committed Jul 1, 2014
1 parent 70ccef4 commit 2643696
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/MetaCPAN/Server/Controller/Stargazer.pm
@@ -0,0 +1,26 @@
package MetaCPAN::Server::Controller::Stargazer;

use strict;
use warnings;

use Moose;

BEGIN { extends 'MetaCPAN::Server::Controller' }

with 'MetaCPAN::Server::Role::JSONP';

sub find : Path('') : Args(2) {
my ( $self, $c, $user, $module ) = @_;
eval {

This comment has been minimized.

Copy link
@oalders

oalders Jul 3, 2014

Member

Any reason you're using eval here rather than Try::Tiny?

my $stargazer = $self->model($c)->raw->get(
{
user => $user,
module => $module
}
);
$c->stash( $stargazer->{_source} || $stargazer->{fields} );
} or $c->detach( '/not_found', [$@] );
}

__PACKAGE__->meta->make_immutable;
1;

0 comments on commit 2643696

Please sign in to comment.