Skip to content

Issue394#397

Open
StepanSaenko wants to merge 8 commits into
masterfrom
issue394
Open

Issue394#397
StepanSaenko wants to merge 8 commits into
masterfrom
issue394

Conversation

@StepanSaenko

Copy link
Copy Markdown
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
@StepanSaenko StepanSaenko requested a review from MarioStanke July 1, 2023 10:44

@MarioStanke MarioStanke left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread src/phylotree.cc Outdated
Comment thread src/phylotree.cc
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

indentation

Comment thread src/phylotree.cc
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
Copy Markdown
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

Comment thread 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
Copy Markdown
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?

Comment thread src/phylotree.cc Outdated
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