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

Issue394 #397

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Issue394 #397

wants to merge 8 commits into from

Conversation

StepanSaenko
Copy link
Collaborator

Added catching an exception for the error "An out_of_range exception occurred: vector::_M_range_check: __n (which is 12157) >= this->size() (which is 3)" possibly caused by an error in .nwk file

If the node is named with only digit symbols, it can be the reason of the error:

terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 12157) >= this->size() (which is 3)
Aborted (core dumped)

A function added to phylotree.cc shows a possible explanation
Added an std::out_of_range exception
Copy link
Contributor

@MarioStanke MarioStanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except for some indentation and a possibly unnecessary include.

src/phylotree.cc Outdated Show resolved Hide resolved
int error_message = parser.parse();
if(error_message == 1){
throw ProjectError("the parsing of " + filename + " has been unsuccessful. Please check, whether the syntax of your input file is correct" );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

std::cout << "An out_of_range exception occurred: " << e.what() << std::endl;
throw ProjectError("the parsing of " + filename + " has been unsuccessful. Probably, at least one node named with only digits. Please check, whether the syntax of your input file is correct" );
}
fb.close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation inconsistent with previous line

src/phylotree.cc Outdated
Comment on lines 20 to 25
#include <iostream>
#include <stdio.h>
#include <stack>
#include <string>
#include <regex>
#include <stdexcept>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove duplicates and unnecessary includes. Is regex used at all?

src/phylotree.cc Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants