dfx_core/error/
structured_file.rs1use crate::error::fs::{ReadFileError, WriteFileError};
2use std::path::PathBuf;
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum StructuredFileError {
7 #[error("failed to parse contents of {0} as json")]
8 DeserializeJsonFileFailed(Box<PathBuf>, #[source] serde_json::Error),
9
10 #[error("failed to read JSON file")]
11 ReadJsonFileFailed(#[from] ReadFileError),
12
13 #[error("failed to serialize JSON to {0}")]
14 SerializeJsonFileFailed(Box<PathBuf>, #[source] serde_json::Error),
15
16 #[error("failed to write JSON file")]
17 WriteJsonFileFailed(#[from] WriteFileError),
18}