mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
Merge pull request #8897 from timotheecour/pr_startProcessAuxSpawn_raiseOSError_context
add data.sysCommand when startProcessAuxSpawn raises
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user