From 7eb794f8695d10d1f3b183209ea0f385efaee9be Mon Sep 17 00:00:00 2001
From: "Andrew E. Torda" <torda@zbh.uni-hamburg.de>
Date: Mon, 30 May 2022 16:52:12 +0200
Subject: [PATCH] Wrapper around a windows file error, which was rather
 cryptic.

---
 mc_work/dorun.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mc_work/dorun.go b/mc_work/dorun.go
index 5ae5460..9a40898 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
-- 
GitLab