Added exception handling to ADAP3D task
@@ -126,8 +126,14 @@ public class ADAP3DTask extends AbstractTask {
Predicate<MsScan> scanSelectionPredicate =
scan -> selectedScans.contains(((MZmineToMSDKMsScan) scan).getMzmineScan());
msdkADAP3DMethod = new ADAP3DFeatureDetectionMethod(msdkRawDataFile, scanSelectionPredicate);
-
- List<Feature> features = msdkADAP3DMethod.execute();
+ List<Feature> features = null;
+ try {
+ features = msdkADAP3DMethod.execute();
+ } catch (Exception e) {
+ e.printStackTrace();
+ setStatus(TaskStatus.ERROR);
+ setErrorMessage("Error in ADAP3D: " + e.getMessage());
+ }
logger.info("ADAP3D detected " + features.size() + " features in " + dataFile
+ ", converting to MZmine peaklist");
@@ -136,7 +142,8 @@ public class ADAP3DTask extends AbstractTask {
int rowId = 1;
for (Feature msdkFeature : features) {
- SimpleFeature mzmineFeature = new SimpleFeature(dataFile, FeatureStatus.DETECTED, msdkFeature);
+ SimpleFeature mzmineFeature =
+ new SimpleFeature(dataFile, FeatureStatus.DETECTED, msdkFeature);
PeakListRow row = new SimplePeakListRow(rowId);
row.addPeak(dataFile, mzmineFeature);
newPeakList.addRow(row);
