diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-08-23 21:57:45 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-08-23 21:57:45 +0100 |
commit | 1b73cd41bf71a76800a4da3e8c35f18e83b264c9 (patch) | |
tree | 4726ad1005662ed3f1442fe31024bb894643a240 | |
parent | fe190ee83f2d0d1f2ee4c7e6e0c01cbb73504688 (diff) | |
download | Nim-1b73cd41bf71a76800a4da3e8c35f18e83b264c9.tar.gz |
Improves osproc.startProcess error message. Fixes #2183.
-rw-r--r-- | lib/pure/osproc.nim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index add4bc0a8..671e69a49 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -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 |