From 9dc14da0baf08d359ecfab6f8634ec2a0cdb6924 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 5 Mar 2025 18:04:52 +0000 Subject: [PATCH] Fix missing details when logging errors --- src/archive/parse.rs | 7 +++++-- src/game.rs | 4 ++-- src/logging.rs | 10 ++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/archive/parse.rs b/src/archive/parse.rs index 2976aaa5..2e3ca660 100644 --- a/src/archive/parse.rs +++ b/src/archive/parse.rs @@ -6,7 +6,10 @@ use std::{ }; use super::error::{ArchiveParsingError, ArchivePathParsingError}; -use crate::{logging, plugin::has_ascii_extension}; +use crate::{ + logging::{self, format_details}, + plugin::has_ascii_extension, +}; use super::{ba2, bsa}; @@ -25,7 +28,7 @@ pub fn assets_in_archives(archive_paths: &[PathBuf]) -> BTreeMap(error: &E) -> String { + let mut details = error.to_string(); // The display string. + if let Some(source) = error.source() { + details += ": "; + details += &format_details(&source) + } + + details +} + #[cfg(test)] mod tests { use super::*;