Give more informative error messages when failing to write files
This commit is contained in:
parent
bb5dedfb1e
commit
8f4096e5cb
2 changed files with 26 additions and 16 deletions
|
|
@ -432,7 +432,9 @@ pub fn generate_property_sheets(repo_path: &Path) -> Result<()> {
|
|||
let property_sheet_json_path = src_dir_path
|
||||
.join(css_path.file_name().unwrap())
|
||||
.with_extension("json");
|
||||
let property_sheet_json_file = File::create(property_sheet_json_path)?;
|
||||
let property_sheet_json_file = File::create(&property_sheet_json_path).map_err(|e|
|
||||
format!("Failed to create {:?}: {}", property_sheet_json_path, e)
|
||||
)?;
|
||||
let mut writer = BufWriter::new(property_sheet_json_file);
|
||||
serde_json::to_writer_pretty(&mut writer, &sheet)?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue