Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible precedence issue with control flow operator at Bio/DB/IndexedBase.pm line 805 #355

Open
hyphaltip opened this issue Feb 5, 2021 · 3 comments
Labels

Comments

@hyphaltip
Copy link
Member

This warning has shown up for years --

I don't remember the exact logic intended but should the return be inside the eval to avoid the ambiguity? Here's my proposed solution - anyone want to look and test - it seems to run okay when I change locally and am trying out in some limited tests.

    eval {
      return $self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
    } or $self->throw( "Can't open file $file" );
@cjfields
Copy link
Member

Seems like the logic is to die if the File::Spec->catfile($self->{dirname}, $file) call is performed; notably $@ isn't checked. I'm guessing it's okay to return from inside an eval, but I would do it something like the below, which is more explicit about the intent:

# completely untested
my $fh = eval {
     $self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
    };
$self->throw( "Can't open file $file: $@" ) if $@;
return $fh;

@alanhoyle
Copy link

I am seeing this warning as well. It occurs for me when the current version of VEP (103.1) is installed using Bioconda, and VEP throws the warning at startup every time.

@hyphaltip
Copy link
Member Author

hyphaltip commented Apr 24, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants