Set exception instead of raising when call fails, also ensure that any of the ways the pipe write fails are caught and handled consistently.