Refactoring of all SequenceAnnotation web services
[jabaws.git] / runner / compbio / runner / Util.java
index 47f169b..41bddd4 100644 (file)
@@ -37,6 +37,7 @@ import compbio.engine.client.ConfExecutable;
 import compbio.engine.client.ConfiguredExecutable;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.conf.PropertyHelperManager;\r
+import compbio.metadata.JobSubmissionException;\r
 import compbio.metadata.PresetManager;\r
 import compbio.metadata.RunnerConfig;\r
 import compbio.util.PropertyHelper;\r
@@ -113,18 +114,20 @@ public final class Util {
        }\r
 \r
        public static void writeInput(List<FastaSequence> sequences,\r
-                       ConfiguredExecutable<?> exec) {\r
+                       ConfiguredExecutable<?> exec) throws JobSubmissionException {\r
 \r
-               File filein = new File(exec.getInput());\r
                try {\r
+                       File filein = new File(exec.getInput());\r
                        FileOutputStream fout = new FileOutputStream(filein);\r
                        log.debug("File path: " + filein.getAbsolutePath());\r
                        SequenceUtil.writeFasta(fout, sequences);\r
                        fout.close();\r
-               } catch (FileNotFoundException e) {\r
-                       e.printStackTrace();\r
                } catch (IOException e) {\r
-                       e.printStackTrace();\r
+                       log.error("IOException while writing input file into the disk: "\r
+                                       + e.getLocalizedMessage(), e);\r
+                       throw new JobSubmissionException(\r
+                                       "We are sorry by JABAWS server seems to have a problem! "\r
+                                                       + e.getLocalizedMessage(), e);\r
                }\r
        }\r
 \r