diff options
-rw-r--r-- | lib/pure/includes/oserr.nim | 8 | ||||
-rw-r--r-- | lib/pure/osproc.nim | 2 |
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: |