9307: Improve crunchrunner error handling. Fix typo.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 6 Oct 2016 15:25:53 +0000 (11:25 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 6 Oct 2016 15:26:26 +0000 (11:26 -0400)
sdk/cwl/arvados_cwl/arv-cwl-schema.yml
sdk/go/crunchrunner/crunchrunner.go

index fe3eadd8e53163e8b545da97b7c85c50ed6f05f0..ee1834779dc8d0508b344f6819024eab502b4439 100644 (file)
@@ -22,7 +22,7 @@ $graph:
     - |
       local_output_dir: Use regular file system local to the compute node.
       There must be sufficient local scratch space to store entire output;
-      specify this this with `outdirMin` of `ResourceRequirement`.  Files are
+      specify this with `outdirMin` of `ResourceRequirement`.  Files are
       batch uploaded to Keep when the process completes.  Most compatible, but
       upload step can be time consuming for very large files.
     - |
index 8dffd4594f1393e87dae91d1a0ee12c285826a25..5e0e101e7726b25d3791d137a7196d2b219782d6 100644 (file)
@@ -115,10 +115,12 @@ func setupCommand(cmd *exec.Cmd, taskp TaskDef, outdir string, replacements map[
                                return "", "", "", err
                        }
                        if taskp.KeepTmpOutput {
-                               // Is there an os.Copy?
-                               copyFile(v, outdir+"/"+k)
+                               err = copyFile(v, outdir+"/"+k)
                        } else {
-                               os.Symlink(v, outdir+"/"+k)
+                               err = os.Symlink(v, outdir+"/"+k)
+                       }
+                       if err != nil {
+                               return "", "", "", err
                        }
                }
        }
@@ -222,8 +224,8 @@ func getKeepTmp(outdir string) (manifest string, err error) {
                return "", err
        }
        collection := arvados.Collection{}
-       json.Unmarshal(buf, &collection)
-       return collection.ManifestText, nil
+       err = json.Unmarshal(buf, &collection)
+       return collection.ManifestText, err
 }
 
 func runner(api IArvadosClient,
@@ -364,9 +366,9 @@ func runner(api IArvadosClient,
                manifest, err = getKeepTmp(outdir)
        } else {
                manifest, err = WriteTree(kc, outdir)
-               if err != nil {
-                       return TempFail{err}
-               }
+       }
+       if err != nil {
+               return TempFail{err}
        }
 
        // Set status