Skip to content

Commit

Permalink
Merge pull request #5210 from solgenomics/fix_missing_analysis_page
Browse files Browse the repository at this point in the history
Fix server error on missing analysis ID
  • Loading branch information
lukasmueller authored Nov 20, 2024
2 parents 2c997ea + 1559186 commit ab33802
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/SGN/Controller/Analysis.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ sub analysis_detail :Path('/analyses') Args(1) {
my $bcs_schema = $c->dbic_schema("Bio::Chado::Schema", undef, $user_id);
print STDERR "Viewing analysis with id $analysis_id\n";

eval {
my $a = CXGN::Analysis->new({
bcs_schema => $bcs_schema,
people_schema => $c->dbic_schema("CXGN::People::Schema", undef, $user_id),
metadata_schema => $c->dbic_schema("CXGN::Metadata::Schema", undef, $user_id),
phenome_schema => $c->dbic_schema("CXGN::Phenome::Schema", undef, $user_id),
trial_id => $analysis_id,
});
};

if (! $a) {
if ($@) {
$c->stash->{template} = '/generic_message.mas';
$c->stash->{message} = 'The requested analysis ID does not exist in the database.';
$c->stash->{message} = 'The requested analysis ID does not exist in the database or has been deleted.';
return;
}

Expand Down

0 comments on commit ab33802

Please sign in to comment.