- bool isMissingRequiredFields = false;
-
- // if @SQ line exists, SN must be provided
- if ( !seq.HasName() ) {
- isMissingRequiredFields = true;
- cerr << "SamFormatParser ERROR: @SQ line is missing SN tag" << endl;
- }
-
- // if @SQ line exists, LN must be provided
- if ( !seq.HasLength() ) {
- isMissingRequiredFields = true;
- cerr << "SamFormatParser ERROR: @SQ line is missing LN tag" << endl;
- }
+ // check for required tags
+ if ( !seq.HasName() )
+ throw BamException("SamFormatParser::ParseSQLine", "@SQ line is missing SN tag");
+ if ( !seq.HasLength() )
+ throw BamException("SamFormatParser::ParseSQLine", "@SQ line is missing LN tag");