diff --git a/crates/snapbox/src/data/mod.rs b/crates/snapbox/src/data/mod.rs index feae56db..9522ce20 100644 --- a/crates/snapbox/src/data/mod.rs +++ b/crates/snapbox/src/data/mod.rs @@ -487,9 +487,21 @@ impl Data { /// /// This is generally used for `expected` data pub fn is(self, format: DataFormat) -> Self { + let filters = self.filters; + let source = self.source.clone(); match self.try_is(format) { Ok(new) => new, - Err(err) => Self::error(err, format), + Err(err) => { + let inner = DataInner::Error(DataError { + error: err, + intended: format, + }); + Self { + inner, + source, + filters, + } + } } }