writeAll should return error