diff --git a/mc_work/dorun.go b/mc_work/dorun.go index 5ae54601514234ae76769dafdaa1a697238c135d..9a408987a20c25ce004adf0c3fb9abe86150e1cb 100644 --- a/mc_work/dorun.go +++ b/mc_work/dorun.go @@ -84,7 +84,7 @@ func setupRun(mcPrm *McPrm, cprm *cprm) error { return err } if cprm.fOutRaw, err = os.Create(mcPrm.fOutName); err != nil { - return err + return fmt.Errorf ("Trying to create file: %w", err) } cprm.fOut = bufio.NewWriter(cprm.fOutRaw) cprm.doTxtFval = true // other parts of code can see that we are writing to file @@ -95,7 +95,7 @@ func setupRun(mcPrm *McPrm, cprm *cprm) error { return fmt.Errorf("broke setting plot filename: %w", err) } if cprm.fplotWrt, err = os.Create(mcPrm.fPltName); err != nil { - return err + return fmt.Errorf ("Trying to create file: %w", err) } } else { // Must be writing to a screen var w bytes.Buffer // could be fancier. Preallocate and use bytes.Newbuffer