Skip to content

Commit

Permalink
fix unhandled ScriptManagerException
Browse files Browse the repository at this point in the history
The exception thrown when input FASTA has N-containing sequences is not properly handled. This commit adds appropriate `throws` and `catch` statements
  • Loading branch information
owlang committed Dec 7, 2023
1 parent c9f19a8 commit dc8670c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -100,7 +101,7 @@ public DNAShapefromFASTAOutput(ArrayList<File> 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++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit dc8670c

Please sign in to comment.