Skip to content
Snippets Groups Projects
Commit c3829e6e authored by Studer Gabriel's avatar Studer Gabriel
Browse files

More descriptive error in io.LoadSequenceList()

The reason are potentially huge fasta files for which debugging is super
hard when you're just told: something is wrong...
parent 8784e3ac
Branches
Tags
No related merge requests found
...@@ -111,7 +111,7 @@ void FastaIOHandler::Import(seq::SequenceList& aln, ...@@ -111,7 +111,7 @@ void FastaIOHandler::Import(seq::SequenceList& aln,
aln.AddSequence(seq); aln.AddSequence(seq);
seq_count+=1; seq_count+=1;
} catch (seq::InvalidSequence& e) { } catch (seq::InvalidSequence& e) {
throw e; throw seq::InvalidSequence("Failed for sequence with name " + name + ": " + e.what());
} }
} else { } else {
throw IOException("Bad FASTA file: Sequence is empty."); throw IOException("Bad FASTA file: Sequence is empty.");
......
...@@ -31,6 +31,9 @@ public: ...@@ -31,6 +31,9 @@ public:
InvalidSequence() InvalidSequence()
: Error("Sequence String contains illegal characters. Must " : Error("Sequence String contains illegal characters. Must "
"be one of [A-Za-z?-].") { } "be one of [A-Za-z?-].") { }
InvalidSequence(const String& custom_msg)
: Error(custom_msg) {}
}; };
class DLLEXPORT InvalidAlignment : public Error { class DLLEXPORT InvalidAlignment : public Error {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment