HaxeFoundation / HaxeFoundation/haxe

[eval] Better error message for process spawning error

Open
#8,210 1 comment 0 reactions 0 assignees View on GitHub
error-reporting platform-eval priority-netherlands
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class EvalSpawn {
public static function main():Void {
for (i in 0...100) {
var proc = new sys.io.Process("sleep", ["0"]);
proc.exitCode();
}
}
}
```

The above results in:

```
Uncaught exception process_run
/haxe/std/eval/_std/sys/io/Process.hx:1: character 1 : Called from here
EvalSpawn.hx:4: characters 15-49 : Called from here
```

Adding `proc.close()` fixes this of course, but the error message is not really helpful. Could `eval` detect it cannot spawn another process and throw a "resource exhaustion" (or similar) exception?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.