Skip to content

Commit

Permalink
Do eval in calling get_vrule in summarize_vrule
Browse files Browse the repository at this point in the history
  • Loading branch information
hirose31 committed Mar 4, 2014
1 parent ad02485 commit 7987706
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/GrowthForecast/Web.pm
Expand Up @@ -1272,7 +1272,15 @@ sub summarize_vrule {

my $graph_path = '/'.join('/', $c->args->{service_name}||(), $c->args->{section_name}||(), $c->args->{graph_name}||());

my @vrules = $self->data->get_vrule($result->valid('t'), $result->valid('from'), $result->valid('to'), $graph_path);
my @vrules;
eval {
@vrules = $self->data->get_vrule($result->valid('t'), $result->valid('from'), $result->valid('to'), $graph_path);
};
if ( $@ ) {
die sprintf "Error:%s %s/%s/%s => %s,%s,%s",
$@, $c->args->{service_name}, $c->args->{section_name}, $c->args->{graph_name},
$result->valid('t'), $result->valid('from') , $result->valid('to');
}

$c->render_json(\@vrules);
};
Expand Down

0 comments on commit 7987706

Please sign in to comment.