diff --git a/runtime/src/file_data.rs b/runtime/src/file_data.rs index b44a9f1c..a5aa9186 100644 --- a/runtime/src/file_data.rs +++ b/runtime/src/file_data.rs @@ -123,9 +123,13 @@ async fn stream_data(file_path: &str) -> Result { } let file_path_clone = file_path.to_owned(); - let fmt = tokio::task::spawn_blocking(move || { - FileFormat::from_file(&file_path_clone) - }).await??; + let fmt = match FileFormat::from_file(&file_path_clone) { + Ok(format) => format, + Err(error) => { + error!("Failed to determine file format for '{file_path}': {error}"); + return Err(format!("Failed to determine file format for '{file_path}': {error}").into()); + }, + }; let ext = file_path.split('.').next_back().unwrap_or(""); debug!("Extracting data from file: '{file_path}', format: '{fmt:?}', extension: '{ext}'");