purescript-node/purescript-node-child-process

Handle failed creation better

hdgarrood opened this issue · 3 comments

Currently, Node.ChildProcess.spawn with a non-existent executable will return a ChildProcess which isn't "real". For example, its pid will be undefined. This is not ideal.

Currently, you have to handle this by calling onError. Unfortunately, onError is used for other failure conditions that do not happen immediately; see the Node docs.

It's not currently clear to me how best to handle this.

paluh commented

@hdgarrood Won't Nullable Int just work in this case? I can provide PR if you agree.

If I remember correctly I considered that option and found that it had some drawback, but I now don’t remember what it was. I’ll check again soon once my exams are over. If it has been a month and I haven’t responded again please feel free to ping me on this thread.

paluh commented

@hdgarrood Thanks for the response and good luck on your exams!