summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2018-09-06 03:12:10 -0700
committerTimothee Cour <timothee.cour2@gmail.com>2018-09-06 03:12:10 -0700
commit67aa8eab0b7f3c37c9c7936154ec567c8fdc1ec5 (patch)
treef53f5c4fb0bd819912e92a53898e958943b85561 /lib
parent36e6ca16d1ece106d88fbb951b544b80c360d600 (diff)
downloadNim-67aa8eab0b7f3c37c9c7936154ec567c8fdc1ec5.tar.gz
add data.sysCommand when startProcessAuxSpawn raises
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/includes/oserr.nim8
-rw-r--r--lib/pure/osproc.nim2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/includes/oserr.nim b/lib/pure/includes/oserr.nim
index 493e8e174..31212d0d1 100644
--- a/lib/pure/includes/oserr.nim
+++ b/lib/pure/includes/oserr.nim
@@ -57,10 +57,10 @@ proc raiseOSError*(errorCode: OSErrorCode; additionalInfo = "") {.noinline.} =
   ## the message ``unknown OS error`` will be used.
   var e: ref OSError; new(e)
   e.errorCode = errorCode.int32
-  if additionalInfo.len == 0:
-    e.msg = osErrorMsg(errorCode)
-  else:
-    e.msg = osErrorMsg(errorCode) & "\nAdditional info: '" & additionalInfo & "'"
+  e.msg = osErrorMsg(errorCode)
+  if additionalInfo.len > 0:
+    e.msg.add  "; Additional info: "
+    e.msg.addQuoted additionalInfo
   if e.msg == "":
     e.msg = "unknown OS error"
   raise e
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index faeb01407..d7b734dda 100644
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -902,7 +902,7 @@ elif not defined(useNimRtl):
 
       discard posix_spawn_file_actions_destroy(fops)
       discard posix_spawnattr_destroy(attr)
-      if res != 0'i32: raiseOSError(OSErrorCode(res))
+      if res != 0'i32: raiseOSError(OSErrorCode(res), data.sysCommand)
 
       return pid
   else: