summary refs log tree commit diff stats
path: root/tests/parser
diff options
context:
space:
mode:
author握猫猫 <164346864@qq.com>2023-11-18 05:06:46 +0800
committerGitHub <noreply@github.com>2023-11-17 22:06:46 +0100
commit39fbd30513fbabb8ff189dcb60991a08f912f6da (patch)
treee50026e3a2b68f4a04fd2dbff294aa0ec886d1a6 /tests/parser
parentfbfd4deccad4d73922caa70567ce8960681f3d54 (diff)
downloadNim-39fbd30513fbabb8ff189dcb60991a08f912f6da.tar.gz
Fix OSError `errorCode` field is not assigned a value (#22954)
In this PR, the following changes were made:
1. Replaced `raise newException(OSError, osErrorMsg(errno))` in batches
with `raiseOSError(errcode)`.
2. Replaced `newException(OSError, osErrorMsg(errno))` in batches with
`newOSError(errcode)`.

There are still some places that have not been replaced. After checking,
they are not system errors in the traditional sense.

```nim
proc dlclose(lib: LibHandle) =
  raise newException(OSError, "dlclose not implemented on Nintendo Switch!")
```

```nim
if not fileExists(result) and not dirExists(result):
  # consider using: `raiseOSError(osLastError(), result)`
  raise newException(OSError, "file '" & result & "' does not exist")
```

```nim
proc paramStr*(i: int): string =
  raise newException(OSError, "paramStr is not implemented on Genode")
```
Diffstat (limited to 'tests/parser')
0 files changed, 0 insertions, 0 deletions