open_file_locked: improve error message
This commit is contained in:
		@ -109,8 +109,11 @@ pub fn open_file_locked<P: AsRef<Path>>(path: P, timeout: Duration)
 | 
				
			|||||||
            Err(err) => bail!("Unable to open lock {:?} - {}",
 | 
					            Err(err) => bail!("Unable to open lock {:?} - {}",
 | 
				
			||||||
                              path, err),
 | 
					                              path, err),
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    lock_file(&mut file, true, Some(timeout))?;
 | 
					    match lock_file(&mut file, true, Some(timeout)) {
 | 
				
			||||||
    Ok(file)
 | 
					        Ok(_) => Ok(file),
 | 
				
			||||||
 | 
					        Err(err) => bail!("Unable to aquire lock {:?} - {}",
 | 
				
			||||||
 | 
					                          path, err),
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Note: We cannot implement an Iterator, because Iterators cannot
 | 
					// Note: We cannot implement an Iterator, because Iterators cannot
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user