These are all ignoring the error.  I would also suggest using writeElements so you only have to check the error once and will detect any error in any of them.