mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
don't treat media file open errors other than NotFound as missing media
For example, we want to return M_UNKNOWN and propagate the error if somebody set up their database directory permissions wrong.
This commit is contained in:
parent
67f0689d73
commit
f216112455
1 changed files with 6 additions and 2 deletions
|
|
@ -392,8 +392,12 @@ impl Service {
|
|||
key: &MediaFileKey,
|
||||
) -> Result<Option<Vec<u8>>> {
|
||||
let path = services().globals.get_media_file(key);
|
||||
let Ok(mut file) = File::open(path).await else {
|
||||
return Ok(None);
|
||||
let mut file = match File::open(path).await {
|
||||
Ok(file) => file,
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
return Ok(None)
|
||||
}
|
||||
Err(e) => return Err(e.into()),
|
||||
};
|
||||
|
||||
let mut data = Vec::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue