Added missing throw clause, was failing to report write errors