mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-22 21:55:15 +00:00
Drop SnapshotError in favor of anyhow::Error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::{borrow::Cow, collections::HashMap, path::Path};
|
||||
|
||||
use anyhow::Context;
|
||||
use memofs::Vfs;
|
||||
use rbx_dom_weak::UnresolvedRbxValue;
|
||||
use rbx_reflection::try_resolve_value;
|
||||
@@ -7,7 +8,7 @@ use serde::Deserialize;
|
||||
|
||||
use crate::snapshot::{InstanceContext, InstanceSnapshot};
|
||||
|
||||
use super::{error::SnapshotError, middleware::SnapshotInstanceResult};
|
||||
use super::middleware::SnapshotInstanceResult;
|
||||
|
||||
pub fn snapshot_json_model(
|
||||
context: &InstanceContext,
|
||||
@@ -17,7 +18,7 @@ pub fn snapshot_json_model(
|
||||
) -> SnapshotInstanceResult {
|
||||
let contents = vfs.read(path)?;
|
||||
let instance: JsonModel = serde_json::from_slice(&contents)
|
||||
.map_err(|source| SnapshotError::malformed_model_json(source, path))?;
|
||||
.with_context(|| format!("File is not a valid JSON model: {}", path.display()))?;
|
||||
|
||||
let mut snapshot = instance.core.into_snapshot(instance_name.to_owned());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user