Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
Added better error handling to address issue #514
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-pluskal committed Nov 29, 2018
1 parent 10afbbb commit 8549880
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,23 @@ private void exportPeakListRow(PeakListRow row, BufferedWriter writer,
* precursorScan.getMassList(massListName).getDataPoints() :
* precursorScan.getDataPoints()); } } }
*/ // Do not include MS1 scans (except for isotope pattern)
MassList massList = scan.getMassList(massListName);
if (massList == null) {
setStatus(TaskStatus.ERROR);
String msg = "Scan " + f.getDataFile().getName() + "#" + scan.getScanNumber() + " does not have a mass list named " + massListName;
setErrorMessage(msg);
return;
}
if (mergeMsMs == SiriusExportParameters.MERGE_MODE.NO_MERGE) {
writeHeader(writer, row, f.getDataFile(), polarity, MsType.MSMS,
scan.getScanNumber());
writeSpectrum(writer,
massListName != null ? scan.getMassList(massListName).getDataPoints()
massListName != null ? massList.getDataPoints()
: scan.getDataPoints());
} else {
if (mergeMsMs == SiriusExportParameters.MERGE_MODE.MERGE_OVER_SAMPLES)
sources.add(f.getDataFile().getName());
toMerge.add(massListName != null ? scan.getMassList(massListName).getDataPoints()
toMerge.add(massListName != null ? massList.getDataPoints()
: scan.getDataPoints());
}
}
Expand Down

0 comments on commit 8549880

Please sign in to comment.