eio
eio copied to clipboard
"execve: Argument list too long" should not be a `Failure`
Currently, when passing arguments to a program with the new Eio.Process
API, E2Big
errors are propagated as Failure "execve: Argument list too long"
.
Programs using this API should be able to handle such an error. In my case, I am using this in an interpreter, where I would like to attach a call trace to the exception.
The current Failure
exception effectively makes it impossible to do this robustly, since the error message is expected to be able to change at any point (which is not that unreasonable to expect in this case, since the current message is pretty misleading. The real error is that the total number of bytes is too large, not that there are too many arguments).
At the very least, raising a dedicated exception would prevent Warning 52: fragile constant pattern
when handling the error.