pub fn sync_up(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<()> {
let remote_address = read_remote(remote_config)
- .expect("No remote is configured");
+ .ok_or_else(|| Error::new(Other, "No remote is configured"))?;
create_dir_all(data_directory)?;
let remotes = available_remotes();
for remote in remotes {
pub fn sync_down(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<()> {
let remote_address = read_remote(remote_config)
- .expect("No remote is configured");
+ .ok_or_else(|| Error::new(Other, "No remote is configured"))?;
create_dir_all(data_directory)?;
let remotes = available_remotes();
for remote in remotes {