mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Drop SnapshotError in favor of anyhow::Error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::{collections::BTreeMap, path::Path};
|
||||
|
||||
use anyhow::Context;
|
||||
use maplit::hashmap;
|
||||
use memofs::{IoResultExt, Vfs};
|
||||
use rbx_dom_weak::RbxValue;
|
||||
@@ -7,9 +8,7 @@ use serde::Serialize;
|
||||
|
||||
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
|
||||
|
||||
use super::{
|
||||
error::SnapshotError, meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult,
|
||||
};
|
||||
use super::{meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult};
|
||||
|
||||
pub fn snapshot_csv(
|
||||
_context: &InstanceContext,
|
||||
@@ -20,8 +19,12 @@ pub fn snapshot_csv(
|
||||
let meta_path = path.with_file_name(format!("{}.meta.json", instance_name));
|
||||
let contents = vfs.read(path)?;
|
||||
|
||||
let table_contents = convert_localization_csv(&contents)
|
||||
.map_err(|source| SnapshotError::malformed_l10n_csv(source, path))?;
|
||||
let table_contents = convert_localization_csv(&contents).with_context(|| {
|
||||
format!(
|
||||
"File was not a valid LocalizationTable CSV file: {}",
|
||||
path.display()
|
||||
)
|
||||
})?;
|
||||
|
||||
let mut snapshot = InstanceSnapshot::new()
|
||||
.name(instance_name)
|
||||
|
||||
Reference in New Issue
Block a user