mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
Actually return a sensible error from create_new_file()
This commit is contained in:
committed by
Floris Bruynooghe
parent
5aaafb5ac1
commit
8753fd5887
@@ -93,7 +93,7 @@ impl<'a> BlobObject<'a> {
|
|||||||
) -> Result<(String, fs::File), BlobError> {
|
) -> Result<(String, fs::File), BlobError> {
|
||||||
let max_attempt = 15;
|
let max_attempt = 15;
|
||||||
let mut name = format!("{}{}", stem, ext);
|
let mut name = format!("{}{}", stem, ext);
|
||||||
for attempt in 0..max_attempt {
|
for attempt in 1..=max_attempt {
|
||||||
let path = dir.join(&name);
|
let path = dir.join(&name);
|
||||||
match fs::OpenOptions::new()
|
match fs::OpenOptions::new()
|
||||||
.create_new(true)
|
.create_new(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user