`to_json_file` now reports I/O error