From f0647823b2e430cb42fe176c4e637f09fd69c276 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 2 Oct 2023 08:54:58 +0200 Subject: handle missing file correctly --- remuxer/src/seek_index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remuxer') 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 */ -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>>> { 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"); -- cgit v1.2.3-70-g09d2