Adding test to propagate error in shell.capture_io.