Skip to content

static walkDir(checkDir=true) does not raise error #24521

Open
@capocasa

Description

@capocasa

Description

According to docs, calling walkDir with the parameter checkDir=true should raise an error if the directory doesn't exist.

This does not happen in a static block.

# foo.nim
static:
  walkDir("nonexistantdirectory), checkDir=true)

$ nim c foo
# compile successful, no error raised

Nim Version

Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 78983f1
active boot switches: -d:release

Current Output

No outputError: unhandled exception: No such file or directory
Additional info: this-should-not-exist [OSError]

Expected Output

Error: unhandled exception: No such file or directory
Additional info: nonexistantdirectory [OSError]

Known Workarounds

Check manually

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions