diff options
author | Araq <rumpf_a@web.de> | 2014-03-13 02:52:51 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-03-13 02:52:51 +0100 |
commit | 1c35fb3c89bbac393b50c4bc6fe8205af2b7fb9d (patch) | |
tree | 6f72beee37e3873a1434e10e8bb0fd156acdef78 /lib/pure/os.nim | |
parent | 2fc84325c7cfba82c54c652a5f1a795845b169a9 (diff) | |
parent | d2f130c3fc1ffa786e8d323c3cd3c51fd45124da (diff) | |
download | Nim-1c35fb3c89bbac393b50c4bc6fe8205af2b7fb9d.tar.gz |
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'lib/pure/os.nim')
-rw-r--r-- | lib/pure/os.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index bfecc569a..faca17e98 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -260,11 +260,12 @@ proc osError*(errorCode: TOSErrorCode) = ## ## If the error code is ``0`` or an error message could not be retrieved, ## the message ``unknown OS error`` will be used. - let msg = osErrorMsg(errorCode) - if msg == "": - raise newException(EOS, "unknown OS error") - else: - raise newException(EOS, msg) + var e: ref EOS; new(e) + e.errorCode = errorCode.int32 + e.msg = osErrorMsg(errorCode) + if e.msg == "": + e.msg = "unknown OS error" + raise e {.push stackTrace:off.} proc osLastError*(): TOSErrorCode = |