Improves osproc.startProcess error message. Fixes #2183.
This commit is contained in:
parent
fe190ee83f
commit
1b73cd41bf
1 changed files with 8 additions and 1 deletions
|
|
@ -468,7 +468,14 @@ when defined(Windows) and not defined(useNimRtl):
|
|||
fileClose(si.hStdError)
|
||||
|
||||
if e != nil: dealloc(e)
|
||||
if success == 0: raiseOSError(lastError, command)
|
||||
if success == 0:
|
||||
const errInvalidParameter = 87.int
|
||||
const errFileNotFound = 2.int
|
||||
if lastError.int in {errInvalidParameter, errFileNotFound}:
|
||||
raiseOSError(lastError,
|
||||
"Requested command not found: '$1'. OS error:" % command)
|
||||
else:
|
||||
raiseOSError(lastError, command)
|
||||
# Close the handle now so anyone waiting is woken:
|
||||
discard closeHandle(procInfo.hThread)
|
||||
result.fProcessHandle = procInfo.hProcess
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue