diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-02 08:54:58 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-02 08:54:58 +0200 |
commit | f0647823b2e430cb42fe176c4e637f09fd69c276 (patch) | |
tree | ccd6a2496fbae61e24cb08f5514333a1c4f8c12e /remuxer | |
parent | f5af70b87ae6011148b793bb8dab3599876fc4ab (diff) | |
download | jellything-f0647823b2e430cb42fe176c4e637f09fd69c276.tar jellything-f0647823b2e430cb42fe176c4e637f09fd69c276.tar.bz2 jellything-f0647823b2e430cb42fe176c4e637f09fd69c276.tar.zst |
handle missing file correctly
Diffstat (limited to 'remuxer')
-rw-r--r-- | remuxer/src/seek_index.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/remuxer/src/seek_index.rs b/remuxer/src/seek_index.rs index 9204a51..68ccb4a 100644 --- a/remuxer/src/seek_index.rs +++ b/remuxer/src/seek_index.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin <metamuffin.org> */ -use anyhow::Result; +use anyhow::{Context, Result}; use jellybase::cache::cache_memory; use jellycommon::seek_index::{BlockIndex, SeekIndex}; use jellymatroska::{ @@ -18,7 +18,7 @@ use std::{collections::BTreeMap, fs::File, path::Path, sync::Arc}; pub fn get_seek_index(path: &Path) -> anyhow::Result<Arc<BTreeMap<u64, Arc<SeekIndex>>>> { cache_memory(&["seekindex", path.to_str().unwrap()], move || { info!("generating seek index for {path:?}"); - let input = File::open(&path).unwrap(); + let input = File::open(&path).context("opening source file")?; let mut input = EbmlReader::new(input); let index = import_seek_index(&mut input)?; info!("done"); |