return null when failing to write errors