Skip to content

Commit

Permalink
Implementing backup of broken config files
Browse files Browse the repository at this point in the history
This addresses issue #390.
  • Loading branch information
Christiane Ruetten committed May 3, 2016
1 parent 478c34a commit 7f8b38a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/config_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ impl ConfigStore {
Err(error) => {
error!("Unable to generate JSON from config file {}: {}",
file_name, error.to_string());
empty_config
let mut backup_name = file_name.to_owned();
backup_name.push_str("_BROKEN");
warn!("Moving broken config file to {}", backup_name);
let _ = fs::rename(file_name, &backup_name);
warn!("Continuing with empty config file");
empty_config
}
};

Expand Down

0 comments on commit 7f8b38a

Please sign in to comment.