From dc8670c5cc5b62001208959e0daa8fba2f9e41a1 Mon Sep 17 00:00:00 2001 From: owlang Date: Thu, 7 Dec 2023 13:42:02 -0500 Subject: [PATCH] fix unhandled ScriptManagerException The exception thrown when input FASTA has N-containing sequences is not properly handled. This commit adds appropriate `throws` and `catch` statements --- .../Sequence_Analysis/DNAShapefromFASTAOutput.java | 3 ++- .../Sequence_Analysis/DNAShapefromFASTAWindow.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAOutput.java b/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAOutput.java index 6ed1b5ec..21ae151f 100644 --- a/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAOutput.java +++ b/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAOutput.java @@ -19,6 +19,7 @@ import scriptmanager.objects.CustomOutputStream; import scriptmanager.objects.LogItem; import scriptmanager.objects.Exceptions.OptionException; +import scriptmanager.objects.Exceptions.ScriptManagerException; import scriptmanager.util.ExtensionFileFilter; import scriptmanager.cli.Sequence_Analysis.DNAShapefromFASTACLI; @@ -100,7 +101,7 @@ public DNAShapefromFASTAOutput(ArrayList fa, File out_dir, boolean[] type, * @throws IOException Invalid file or parameters * @throws InterruptedException Thrown when more than one script is run at the same time */ - public void run() throws OptionException, FileNotFoundException, IOException, InterruptedException { + public void run() throws ScriptManagerException, OptionException, FileNotFoundException, IOException, InterruptedException { LogItem old_li = null; // Move through each BED File for (int x = 0; x < FASTA.size(); x++) { diff --git a/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAWindow.java b/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAWindow.java index 68b82896..625e46ca 100644 --- a/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAWindow.java +++ b/src/main/java/scriptmanager/window_interface/Sequence_Analysis/DNAShapefromFASTAWindow.java @@ -36,6 +36,7 @@ import javax.swing.border.TitledBorder; import scriptmanager.objects.Exceptions.OptionException; +import scriptmanager.objects.Exceptions.ScriptManagerException; import scriptmanager.objects.ToolDescriptions; import scriptmanager.util.ExtensionFileFilter; import scriptmanager.util.FileSelection; @@ -136,6 +137,8 @@ public void propertyChange(PropertyChangeEvent evt) { output_obj.setVisible(true); output_obj.run(); } + } catch (ScriptManagerException sme) { + JOptionPane.showMessageDialog(null, sme.getMessage()); } catch (OptionException oe) { JOptionPane.showMessageDialog(null, oe.getMessage()); } catch (NumberFormatException nfe) {