If you're hitting EPIPE, rescue EPIPE.  `rescue` with no exception class is almost as bad as `rescue ::Exception` and will hide tons of things, making debugging a nightmare.