Skip to content

Printing an error should stringify structures included in the error message #15

@yzhernand

Description

@yzhernand

I'm using Bio::DB::EUtilities to fetch linked assemblies for some input nuccore accessions. Occasionally, the server responds with an error instead of a history. The result is a warning like this printed to stderr:

--------------------- WARNING ---------------------
MSG: NCBI LinkSet error: nuccore: ARRAY(0x55fa47a7f880)

---------------------------------------------------

I traced the message back to Bio::Tools::EUtilities::Link, line 49. There, the code simply extracts the contents of the 'ERROR' key in the link set (?) and passes it to the warn method.

I added one line of code so that I could turn the arrayref into a string and see what errors I was getting:

$error = join ", ", @$error;
$self->warn("NCBI LinkSet error: $dbfrom: $error\n");

Now I can see what some of the errors were:

--------------------- WARNING ---------------------
MSG: NCBI LinkSet error: nuccore: BLOB ID IS NOT IMPLEMENTED, BLOB ID IS NOT IMPLEMENTED

I could submit a pull request with that change if that acceptable as a solution to you all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions