I'm writing a CLI program, and when I execute the binary like program | head I get:
Error: unhandled exception: errno: 32 `Broken pipe` [IOError]
I'd like to silence this exception and tried to add:
import posix
signal(SIG_PIPE, SIG_IGN)
in my main procedure, but this didn't silence the error. The program uses threadspool, calling another procedure to analyze a pool of input lines. (I don't know if this is relevant to the question)
UPDATE:
- This is my non-working program: https://pastebin.com/aQaRgfXR (threads spawned with
responses.add(spawn parseArray(readspool, mergeOptions))) - This is the full error:
/Users/telatina/miniconda3/nim/lib/pure/concurrency/threadpool.nim(377) slave
/Users/telatina/git/nim-stuff/orf/src/porfidus.nim(307) parseArrayWrapper
/Users/telatina/git/nim-stuff/orf/src/porfidus.nim(247) parseArray
/Users/telatina/miniconda3/nim/lib/system/io.nim(155) checkErr
/Users/telatina/miniconda3/nim/lib/system/io.nim(138) raiseEIO
Error: unhandled exception: errno: 0 `Undefined error: 0` [IOError]